22 ms·
From an architecture perspective, the article is a great read. However, the systemic damage in JS applications comes from profound general delusions concerning
by alfl23 13y ago
From an architecture perspective, the article is a great read. However, the systemic damage in JS applications comes from profound general delusions concerning the JS language itself.
Strong performance anti-patterns can be found in any example listed in your article.
http://stackoverflow.com/questions/12973706/javascript-collection/12973883#12973883 http://stackoverflow.com/questions/12973706/javascript-colle...
- iends 13y agoThis SO post is really good, but some of the points made in the post are not very clear. For example, why is arr['key'] = 5; consider bad? I've read the post and the code, but it's still not clear from the example. When does using Object.prototype.hasOwnProperty lead to bugs? Any benchmarks on case statements being slow? Any additional reading on this type of thing (books, etc)?
- jdlshore 13y agoAs usual, it's best not to sacrifice readability for performance until you have proof of a bottleneck. Most of the code you write isn't performance-critical. And (thanks to existing performance optimizations in everything ranging from the JS VM, to the OS, to the CPU itself) it's very, very easy to be wrong about where your performance problems are. Note the comments under the SO article; most of the micro-"optimizations" are actually slower than normal code. Also, it answers the question wrong. :-b (Arrays are objects in JS, with a bit of extra magic.)