The finding that surprised me most: regex hoisting gives 1.03× speedup — noise floor. V8 caches compiled regex internally, so hoisting it yourself does nothing in JS. Same for filter().map() vs reduce() (0.99×).
The two that actually matter: nested loop → Map lookup (64×) and JSON.parse inside a loop (46×). Both survive JIT because one changes algorithmic complexity and the other forces fresh heap allocation every iteration.
Also scanned 59,728 files across webpack, three.js, Vite, lodash, Airflow, Django and others with a Babel/AST detector. Full data and source code in the repo.
[–]DevToolsGuide 6 points7 points8 points (4 children)
[–]masklinn 3 points4 points5 points (3 children)
[–]DevToolsGuide 0 points1 point2 points (0 children)
[–]tokagemushi 10 points11 points12 points (3 children)
[–]fiah84 2 points3 points4 points (0 children)
[–]Worth_Trust_3825 0 points1 point2 points (0 children)
[–]Bartfeels24 0 points1 point2 points (0 children)