JSPerf.com is a site designed to aid in benchmarking JavaScript snippets to help determine which solution is the most efficient. The results can kind of eye opening. As an example, I picked a random test that was written to test the speed of various frameworks' selection engines. Results are below:
Note that IE7 errored out on two of the tests, making this a little less useful.
Note the numbers of operations a second - each lookup is genuinely expensive in IE7.
IE8 performs much better here (note the ~56x improvement for frameworks).
In addition, look at the speed of querySelectorAll (not supported in IE7). So Fast!
Firefox, as expected, performed admirably.
It is interesting to note, however, that the native solutions were faster.
Safari really blew Firefox out of the water.
3x improvement for frameworks, 11x improvement for native.
Chrome placed between Firefox and Safari.
Morale of the story: JavaScript performance cannot be trivilialized for older browsers.
Now I need a cluster of cpus so I can run all the js I write in every browser in multiple ways.
Posted by: Nick | 08/18/2010 at 03:23 PM