Javascript performance tests

My “Javascript performance experience”:http://virtuelvis.com/archives/2003/05/js-performance from a few days ago inspired me in starting to write a Javascript performance test suite. The first part is the performance of loops. Yes, those lovely for, while and, do…while constructs.


The tests are as follows:
* “for”:http://virtuelvis.com/gallery/jsbenchmarks/loops/001-for.html.
* “while”:http://virtuelvis.com/gallery/jsbenchmarks/loops/002-while.html.
* “do…while”:http://virtuelvis.com/gallery/jsbenchmarks/loops/003-dowhile.html.
* “for … in … 1”:http://virtuelvis.com/gallery/jsbenchmarks/loops/004-forin.html
* “for … in … 2”:http://virtuelvis.com/gallery/jsbenchmarks/loops/005-forin.html
* “for … in … 3”:http://virtuelvis.com/gallery/jsbenchmarks/loops/006-forin.html
I’m not going to draw any conclusions on anything here, I’ll let you do that, and optimize your scripts if neccesary. Please note that the three for ( … in … ) tests are different, and the last one may take several minutes to complete, and may even possibly lock your system while doing so.

Comments are closed.