Posts about design
Categories
- Mar 11 2010
Quickest Loop Through an Object
A little experiment to find the fastest for-loop for an object. Approx. Results: ARY-INDEX: “for(var i = 0” -> 13ms OBJ-INDEX: “for(var i = 0” -> 218ms OBJ-KEY: “for(var i in” -> 975ms var len = 1000000; // ARRAY VERSION var check = 0; var ary = []; for( var i = 0, l = […]
Continue ReadingQuickest Loop Through an Object- Tagged in:
- performance
- Mar 10 2010
Faster Javascript – Part 2
In Faster Javascript Part 1 we compared a three methods for evaluating a string of alien DNA. With Switch, Boolean & Conditional going head to head, Switch was the clear winner with Conditional (Ternary) trailing way behind. Testing methods is one thing, but there’s more to writing fast code than just testing. For example: order […]
Continue ReadingFaster Javascript – Part 2- Tagged in:
- performance