Sunday 19 December 2010

Optimizing JavaScript for Google Chrome

Just wanted to make a note of two things I've discovered while writing highly optimized JavaScript for Google Chrome:

1. for(var i in myArray) is much slower than (for var i=0;i<myarray.length;i++)
2. Inserting objects into arrays is much slower than setting the properties of objects in arrays.

That's all :)