Last Updated: November 09, 2017
· szymonkor

JS performance techniques


I would love to see this post for ES2015. In general, any intermediate JS programmer is aware of the techniques described in the article, but it is sometimes good to recap it all.

Some new stuff for me:

  • Use ‘mouseup’ instead of ‘click’ (3.5) - the article is quite old and I am not sure if it is still a good solution. We will also completely get rid of old IEs in a few years.
  • Using JS objects as efficient data structures (Problem 4, solution 1)
  • Take advantage of reference types. (4.3)
  • Comparing object references is far more efficient than comparing strings. (4.3)
  • Use ‘switch’ instead of lengthy ‘if-then-else’ statements. (5.1)