JS Performance: 10 Commandments


  1. Don’t touch the DOM
  2. Cache DOM reference in local vars
  3. Use selectors API
  4. Cahce the length when looping collections
  5. Update the DOM offline
  6. Batch style changes
  7. Don’t ask for layout info excessively
  8. Minimize reflow areas
  9. Use event delegation
  10. Don’t touch the DOM
Advertisements