Re:JS MythBusters – An optimization handbook from a high lev...
by mintplant on Tuesday August 30, 2016 @04:34PM
(#12393642)
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/Io...
Re:JS MythBusters – An optimization handbook from a high lev...
by choward on Tuesday August 30, 2016 @04:37PM
(#12393675)
Exactly. There are no myths. There is no mythbusting. This has absolutely nothing to do with mythbusters.
It's just some random opinions about optimizations you most likely don't need. Who cares if something is barely faster? If the slower way is a lot more readable, I'm opting for that.
Instead this site seems to be "regurgitate myths". e.g. http://mythbusters.js.org/workflow/boolean-conditions.html
"Avoid using >= and <= unless necessary. It’s faster to use a simpler comparison." There's a trivial code example, and then absolutely no evidence to support the claim. No benchmarks, nothing.