We received reports of excessive codegen compilation/optimization times for very large expressions generated by visualization tools.
- Expose codegen optimization levels as query options. Currently there is only an all or nothing codegen query option. It's likely that overly complex expressions such as hundreds of cascading conditions take very long and benefit very little from an O2 optimization level, but they could still run significantly faster even at O0 or O1 versus interpreted.
- Consider dropping to O1 (or turn off riskier passes individually) automatically for very large expressions.
- Consider parameterizing the compilation duration time limits and set a reasonable default, say 10 seconds. Either disable codegen or reduce it to, say, O0 if compilation takes longer than the preset limit.
In some cases disabling codegen can help.