Like An Elephant In Your Backyard

There really is a lot of rubbish information out there on the Internet, presented by so called “experts”. While researching JavaScript performance tuning for a current project, I came across these charming nuggets:

Iterating loops backwards (decrementing) is faster than incrementing, and when looping though DOM objects by tagname, it’s faster to include the getElementsByTagName is the for loop evaluation statement. I wonder how many people blindly accept this stuff?

Profiling the above coding suggestions in gecko (Firefox) and trident (Internet Explorer 6), showed that in all cases the suggestions resulted in speeds that were either the same or slower. In fact, the getElementsByTagName suggestion under Internet Explorer 6 increased the execution time by 250%, not exactly a performance increase! lol.

Comments are closed.

The All Knowing Trash Heap