jQuery Performance Rules

1 posts, 0 answers
  1. Mostafa Anoosheh
    Mostafa Anoosheh avatar
    462 posts
    Member since:
    Nov 2005

    Posted 02 May 2009 Link to this post

    Once upon a time, all we needed to worry about was reducing Bytes and Requests and playing around with load order to make things faster. Nowadays, we are increasingly impacting one more major component in performance - CPU utilization. Using jQuery and other frameworks that make selecting nodes and DOM manipulation easy can have adverse affects if you’re not careful and follow some simple practices for reducing the work the browser has to do.

    1.Always Descend From an #id
    2.Use Tags Before Classes
    3.Cache jQuery Objects
    4.Harness the Power of Chaining
    5.Use Sub-queries
    6.Limit Direct DOM Manipulation
    7.Leverage Event Delegation (a.k.a. Bubbling)
    8.Eliminate Query Waste
    9.Defer to $(window).load
    10.Compress Your JS
    11.Learn the Library

    Read more at jQuery Performance Rules

    Kind regards,
    Mostafa Anoosheh

Back to Top