3 ms·
The 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
by olliej 6y ago
The 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.