3 ms·
JS is so ultra-optimized by modern browsers that we're going to run into cases like this. It's inevitable. Hopefully they're always treated like bugs and not s
by smt88 6y ago
JS is so ultra-optimized by modern browsers that we're going to run into cases like this. It's inevitable.
Hopefully they're always treated like bugs and not something we need to work around.
- olliej 6y agoThe JSC team (and I suspect V8 and SM) always treat performance cliffs caused by normal/sensible code patterns as a bug. The problem is that when implementing improvements it's easy to forget every mostly-equivalent thing and so miss obvious things (often the entire fix in the end is "if (canDoItFast) doTheExistingFastThing()"
- smt88 6y agoI can imagine some workarounds for that. Go to GitHub and pull the tests for a few thousand libraries, and watch for major performance changes. I mean I'm sure they have a solution, since this seems like a rare occurrence. I will note though that const/let are not mostly equivalent to var. They're often used interchangeably, but they work pretty differently as far as a JS engine is concerned.