Overview
| Artifact ID: | 0b32bbd550e4e859b7c867a1e31d2e6bd517e88a |
|---|---|
| Ticket: | 465811ffffffffffffffffffffffffffffffffff
Optimize if/while/... during compilation |
| User & Date: | andreas_kupries on 2001-09-27 20:50:54 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
This is possibly not a feature request but a performance bug / enhancement. The control commands [if], [while] and [for] currently do not check their expression arguments for static strings and constant expressions. This means that for example if {0} { bla } is compiled into bytecode despite the fact that the code will not be executed, ever. I propose that the compile procedures for the aformentioned commands are extended to detect simple constant expressions and to react accordingly. I.e. not to compile the if/while/for statement at all or only partially and to compile only the sub-scripts which are reachable for the constant expression. This enhancement is along the lines of the optimization for [proc {args} {}], but should present less problems with recompilation as no commands are implicitly added or removed from the interp. It does present a new set of challenges if we want to go beyond the detection of simple constant expressions to the detection of (0 && ...) etc. Note: This is easier for logical expressions as they are defined to have shortcircuit evaluation and thus present less problems with regard to variable tracing. - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "andreas_kupries"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to: "Optimize if/while/... during compilation"
- type changed to: "RFE"