I am currently working on a heavy JS-based tool where every millisecond counts. I've been searching for lesser-known JavaScript performance tricks that go beyond typical optimizations like using web workers or removing unused code. It feels like uncovering hidden knowledge.
One discovery I've made is that using new Array is significantly faster than Array.from or push()[0].
Could you share any similar insights or lesser-known performance optimizations you've come across?
[0] https://www.measurethat.net/Benchmarks/ShowResult/506720
• Learn Rust! When I learned how memory worked, it made me a much better JS dev.
• Check out Casey Muratori's courses on performance. Some are free on YouTube.
• Start from scratch with a data-oriented approach. What bits do you need to move around, and why? What's the best way to store and shape those bits?
• Can/should you use WASM instead?