ECMAScript
- Avoid using
evalor theFunctionconstructor - Avoid using
with - Don't use
try-catch-finallyinside performance-critical functions - Isolate uses of
evalandwith - Avoid using global variables
- Beware of implicit object conversion
- Avoid
for-inin performance-critical functions - Use strings accumulator-style
- Primitive operations can be faster than function calls
- Pass functions, not strings, to
setTimeout()andsetInterval()
DOM
- Repaint and reflow
- Document tree modification
- Modifying an invisible element
- Taking measurements
- Making several style changes at once
- Trading smoothness for speed
- Avoid inspecting large numbers of nodes
- Improve speed with XPath
- Avoid modifications while traversing the DOM
- Cache DOM values in script variables
No comments:
Post a Comment