3 ms·
I'm extremely skeptical of that claim, too. As far as I can tell SpiderMonkey for example will emit practically exactly the same code for >= and <= as other com
by mintplant 10y ago
I'm extremely skeptical of that claim, too. As far as I can tell SpiderMonkey for example will emit practically exactly the same code for >= and <= as other comparisons. In loop optimization SpiderMonkey will actually sometimes rewrite eg. `x < y` as `x + 1 <= y` to put linear inequalities into a standard form for analysis [0].
They also recommend using `let` and `const` over `var` for performance reasons in the "Scope" section, but I have to ask whether they benchmarked that at all. Engines may grow to take advantage of these signals over time for further optimization, but at the moment many ES6 features incur a performance penalty just because the code behind them is less mature. I don't know specifically about `let`/`const` but I'd be pleasantly surprised to learn that they boost performance anywhere yet.
[0] https://dxr.mozilla.org/mozilla-central/source/js/src/jit/IonAnalysis.cpp#3061-3120 https://dxr.mozilla.org/mozilla-central/source/js/src/jit/Io...
- deleted 10y ago[deleted]