2 ms·
I think that just in time compilers are better at doing thier things. Sure it is nice project that can interpret and print preprocessed js, but I think it might
by kasper93 9y ago
I think that just in time compilers are better at doing thier things. Sure it is nice project that can interpret and print preprocessed js, but I think it might in fact not bring speed in most cases.
And the current state doesn't even know how to constant fold this loop.
function foo() {
const bar = 42;
for (let i = 0; i <= bar; i++) {
if (i === bar) {
return bar;
}
}
};
- yairhaimo 9y agoAs long as the ahead of time optimizations that dont have a large enough negative drawback in another criteria (speed vs size) are welcomed by me, even if the JIT can do the same optimizations too. Regarding your code example, maybe prepack was changed in the past week and a half, but it is folded quite fine when i tried it: (function() { function foo() { const bar = 42; for (let i = 0; i <= bar; i++) { if (i === bar) { return bar; } } }; console.log(foo()); })();