ie7 slow searching by class name with 'each'
I've read a lot about how slow IE7/javascript is, but I thought I'd share this test.
I have a complex page with about 15 tables of class XYZ. I timed this:
$('.XYZ').each(function(i){
});
Vs this:
$('TABLE').each(function(i){
});
In IE7 the 1st one takes 1400ms, and the 2nd one takes 30ms.
Apparently searching the DOM by class name is horribly inefficient.
Just thought I'd share, since it took me a while to figure out this slowness...