Best of jsperf (2000-2013) – Part 1/3

Share this article

After surfing through hundreds of jsperf tests, today I bring to you jsperf – best of (2000-2013). For those who don’t know, jsperf.com is an online tool that provides us with JavaScript performance testing. Very useful for Improving your JavaScript & jQuery code performance / comparing the speed of different algorithms and code snippets! This post gives a super fast overview of the results of some of the best ones I’ve seen (so far).

There are quite a few tests so I’ve split them into the following Speed Test groups:

As always leave comments and if I’ve missed any you think are important please share. Let’s improve our coding and speed up the web!

jQuery Selector Speed Tests

These tests compare the performance of the different jQuery selectors.

id vs class vs tag vs pseudo vs. attribute selectors

jquery-id-vs-tag

Quick look at the speed of different jQuery selectors.

jquery-parent-child-selectors

JavaScript String Speed Tests

Concatenating Literals

Comparing the speed of concatenating literals vs one long string assignment
js-literals

String concatenation vs Regex

str-vs-regex

jQuery .size() vs .length.

Testing how much slower the jQuery method size() is against checking the length directly.
size-vs-length

JavaScript DOM Caching/Traversal

DOM Caching vs No DOM Cache

Test the performance of DOM caching in a basic JavaScript namespacing pattern.
dom-cache-loop-111

Caching DOM references outside of a loop

dom-cache1

DOM caching excercise and node types

dom-caching-2

jQuery filter vs find.

Also see JQUERY FILTER FUNCTION EXAMPLE.
filter-vs-find

Sam DeeringSam Deering
View Author

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

jQuery
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week