ECMAScript
- Avoid using
eval
or theFunction
constructor - Avoid using
with
- Don't use
try-catch-finally
inside performance-critical functions - Isolate uses of
eval
andwith
- Avoid using global variables
- Beware of implicit object conversion
- Avoid
for-in
in 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