Follow-up from "Proto: Use saturated arithmetic in the cost model implementation" - use saturation arithmetic more widely
The following discussion from !2330 (merged) should be addressed:
-
@igarnier started a discussion: (+4 comments) When preparing costs for Delphi, with runtime efficiency in mind, we considered carefully which computations to perform in
int
vs performing them inZ
, based on the maximum value of the inputs. Here for instance we perform3 * size
in int because we know that the size of a comb is 2^10 at most.This MR does not change this, which makes it easy to review (which is good). But do we possibly want, in the future (see below), to perform as many computations as possible in
Saturation_repr
?Note that this module will probably have to be largely rewritten anyway since all interpreter and typechecker cost models will have to be updated for 009.