4 ms·
you guys should really check out: http://www.webreference.com/programming/optimize/speedup/chap10/1/index.html http://www.webreference.com/programming/optimize/
by davt 17y ago
you guys should really check out: http://www.webreference.com/programming/optimize/speedup/chap10/1/index.html http://www.webreference.com/programming/optimize/speedup/cha...
I have been creating some pretty crazy interfaces in 3D Javascript. I try everything I read to see if its faster. I find that its resizing elements during an animation that really affect speed. Stopping event bubbling is pretty nice too. But things I didn't know like using reverse loops because comparing to "0" is faster than an int. or setting [i] into variable after the "++" so the whole length isnt processed over and over. What about using "Math." instead of (var calc = a1 * a2 / a3), var calc = Math.round((a1*a2)/a3); because using the preMthods in the dom is faster. These things really work and I saw my performance shoot through the roof!! My number one performance enhancer though? Dont use <img> tags. The way the browsers render <img> is different than (backgroun-image:url();) and takes much more out of the speed than using a CSS background.