[m-dev.] question: how should we handle help for optimization options
Zoltan Somogyi
zoltan.somogyi at runbox.com
Tue Jun 17 13:34:20 AEST 2025
Many optimization options are booleans whose default value
in optdef/optdb is "no", but whose value at the default optimization level
-O2 is "yes". My question is: should the help text for these options say
--optimize-xyz: Enable the xyz optimization,
or should it say
--no-optimize-xyz: Disable the xyz optimization.
When I was adding optdb clauses for the optimization options,
I came across some instances of the second form, but there may have
been some instances of the first as well. (The second form caught my
attention because the help text was in conflict with the default value;
the first form wouldn't have done so, due to the absence of such conflict.)
I don't have a strong preference for either form, but do have a weak
preference for the first form. The reasons are:
- it is more consistent: optimizations are things you turn on, not off
- it does not privilege -O2 over e.g. -O1 or -O3
- it is *very slightly* easier to implement.
Which form do you guys prefer, and why? Could it be a third form?
For example, we could use the first form, but with an automatically added
postscript that says "(This optimization is automaticallly turned on
at optimization levels -O2 and higher.)"
Zoltan.
More information about the developers
mailing list