SQL Engines employ "query rewrite" to effect a more efficient query to supplement user expertise or application knowledge.
Can Mac / Int code generated by Classes be accelerated in a similar way?
Beyond locating inefficient and discouraged code anti-patterns influenced by documented guidance, the idea here is to implement a Mac / Int code rewriter for a FULL "read-ahead" of Mac / Int code base to identify implementation optimizations that can be substituted to accelerate existing int code compiled to obj code.
Speculating some ideas to demonstrate principle:
Replacing once set variable with literal ( as if had been a macro substitution )
In-lining to avoid method call eg: within a loop
Pre-calculate static numeric
Pre_concatenate strings
Switch to naked-global syntax when useful
Substitute more efficient commands or expressions
Drop unreachable code / code blocks ( when procedure block = 1)
Flatten unnecessary code structure
Internal and private Variable / Method shortened / obfuscated
Assist code automation goals like rewriting for code generator emitted output to be more efficient
Benifits:
Can improve existing code bases by recompilation
Potential smaller code footprint for routine memory cache
Faster code execution
Faster generated code ( code generator methods, DTL , BPL, Rules )
Thank you for submitting the idea. The status has been changed to "Needs review".
Stay tuned!