Currently there are a number of flags that control optimizations, one of which is conservative-optimization. There are several problems with this:
It is non-standard among compilers, and many users are unaware of it. As a result, it doesn’t have a sensible default value. If it is off by default, trace messages may be optimized away, leading to confusion. On the other hand, if it is on by default, the scripts will be less efficient.
It means multiple things: (1) ensure traces are not simplified away (2) optimize conservatively so that the costs or sizes are guaranteed to not increase.
We should design optimization flags such that:
They are standard and intuitive
They allow different optimization goals. In some use cases, script size is more important than script cost, while in other use cases it is the opposite.
We can borrow some ideas from GHC or GCC. In GCC, there are flags for optimization levels (O0, O1, O2, O3) and optimization goals (Os, Oz etc.) and it’s a good idea to use similar or the same flag names whenever possible.
Currently there are a number of flags that control optimizations, one of which is conservative-optimization. There are several problems with this:
We should design optimization flags such that:
We can borrow some ideas from GHC or GCC. In GCC, there are flags for optimization levels (O0, O1, O2, O3) and optimization goals (Os, Oz etc.) and it’s a good idea to use similar or the same flag names whenever possible.
A/C: come up with a design of optimization flags.
Extricated from https://input-output.atlassian.net/browse/PLT-9720