jQuery Performance Rules topics include :
jQuery Performance and Optimization Tips topics include :Always Descend From an #id
Use Tags Before Classes
Cache jQuery Objects
Harness the Power of Chaining
Use Sub-queries
Limit Direct DOM Manipulation
Leverage Event Delegation (a.k.a. Bubbling)
Eliminate Query Waste
Defer to $(window).load
Compress Your JS
Learn the Librar
jQuery Performance Tuning Tips - Paul Irish topics include :Stay up to date! Are you using methods and techniques that are obsolete?.
Context-aware jQuery Code Execution – Are you loading code that isn’t needed?
jQuery Unit Testing
Benchmark Your jQuery Code
Keep download times to a minimum with one compressed master JS file.
Context Vs. Find
Window.load all the way.
Strike A Balance Between Your Use Of JavaScript & jQuery
Improving jQuery Performance with Large Data Sets topics include :Optimize selectors for Sizzle’s ‘right to left’ model
Use live() not click()
Pull elements off of the DOM while you play with them
Use find() rather than context
Use HTML 5
Append style tags when styling 15 or more elements
Test selectors using Google Page Speed
Use object detection even if jQuery doesn't throw an error
Use direct functions rather than their convenience counterparts
Learn the lesser known methods
Hopefully these will be enough to get you started on your journey to jQuery performance heaven.Use JavaScript native for() loop instead of jQuery's $.each() helper
function.
Do NOT append an element to the DOM in your loop.
If you have a lot of elements to be inserted into the DOM, surround them
with a parent element for better performance.
Don't use string concatenation, instead use array's join() method for a very long strings.
Use setTimeout() function for your long list looping and concatenation
functions.
No comments:
Post a Comment