Jump to content

Javascript loop performance


hobeau

Recommended Posts

Here's an article I wrote awhile back about javascript loop performance when iterating through the DOM.

 

http://www.solutionbot.com/2008/05/14/javascript-loop-performance/

 

I thought it was interesting to see the differences between IE and all the rest. IE has a severely slow javascript engine and it does not compensate for issues such as this as do other browsers. Keeping your .length function outside of your loops isn't just a 'best practice', it can be the difference between a high performance DHTML app or a sluggish one. Just thought I'd share.

Link to comment
https://forums.phpfreaks.com/topic/138518-javascript-loop-performance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.