Part 2 of the jsperf best of. Enjoy!

JavaScript/jQuery Loop Speed Tests

These test compare ways of looping in JavaScript and jQuery.

Comparison of loops using raw, underscore and interator patterns

for-vs-each

jQuery.each vs. for loop

Also see: SPEED QUESTION JQUERY.EACH VS. FOR LOOP
each-loops

jQuery Ajax Speed Tests

jQuery .live() vs .delegate() vs .on() vs bind()

See post jQuery .on() vs .live() if your unsure what the difference is.
live-on-bind-delegate

$(document).on() vs $(“body”).on()

document-vs-body-on

JSON vs JSONP

See post jQuery AJAX Demos if you want to see some action.
json-vs-jsonp

jsonp-json2

jQuery Animation/CSS Speed Tests

$.css VS $.animate VS $.width

Using $.css() is fastest.
css-vs-animate-vs-width

JavaScript Templating Speed Tests

JavaScript template language shootoff

jquery-templates-comparison

Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.


  • quocvuongdn

    What version of jQuery for this test-case? $.live non-support with jQuery 1.9 or larger!!

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.