| ▲ | vmsp 5 hours ago | |
Is doing stuff like constant folding pre-execution really worth it? I mean, won't the engine itself (V8, JSC, MozJS) be doing it anyway? I know that Google's Closure Compiler — probably still the most advanced JS optimized — also does it but I can't help but think it's probably pointless. | ||
| ▲ | achierius 3 hours ago | parent [-] | |
Stuff like constant folding won't take place until you hit an optimizing compiler tier. For the interpreter and baseline/template-compiler tiers, there's just not enough time to do that sort of dataflow optimization. So yes, it would help at least somewhat, esp. if you don't think the code is likely to tier up much for whatever reason (no one part is all that hot, or perhaps it's too polymorphic). | ||