PERFORMANCE TEST: Caching Node References
This test page demonstrates that, in IE, implementing a caching system for references to nodes that will be referenced frequently offers a substantial and compelling performance benefit over simply repeatedly using the
document.getElementById method on the node IDs. The difference is striking / alarming in IE, while not significant (using these test numbers) in Firefox or Safari.
In the test, HTML for 1000 DIVs is generated and inserted into the page. Then, an entire loop through all of the node IDs is performed 40 times. In the no caching test, the
document.getElementById method is used for every node ID. In the caching test, the