We should be more wary about premature optimizations, like in the article where caching in the original code made it slower! Always measure! Write naive code and measure, the JavaScript engines are very good at optimization, especially V8 and the others are catching up. However when I do optimize JavaScript code I often get 10-100x performance. Usually by writing better algorithms . Eg no "black magic". So the origin…
Caching could have been originally faster, but became slower thanks to the continual improvement of the Javascript VMs.