When developing smaller websites JavaScript performance is often neglected, however when dealing with enterprise level websites such as Lowe’s Home Improvement you start to take these things seriously. Since before I started at Lowe’s I’ve been trying to improve myself when it comes to JavaScript and jQuery, especially in the area of performance. Thankfully a very helpful tool exists, known as jsPerf. The great thing about this tool is that you can setup tests for JavaScript snippets whether its proprietary or library based such as jQuery. I often find myself comparing different jQuery techniques to prove the more optimal, such as the longer hand jQuery dom ready is in fact faster than the shorthand, and bind events are faster than individual event declarations. I haven’t yet tested how the new jQuery 1.7 on/off events perform, but I do hope that by moving all those events into one simple method will not heart the performance aspect.
jsPerf aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks.
