JavaScript performance comparison

Revision 5 of this test case created

Preparation code

<script src="">
<div id="myDiv">
Benchmark.prototype.setup = function() {
    var movies = ['The Shawshank Redemption (1994)', 'The Godfather (1972)', 'The Godfather: Part II (1974)', 'Pulp Fiction (1994)', 'The Good, the Bad and the Ugly (1966)', '12 Angry Men (1957)', 'The Dark Knight (2008)', 'Schindler\'s List (1993)', 'The Lord of the Rings: The Return of the King(2003)', 'Fight Club (1999)', 'Star Wars: Episode V - The Empire Strikes Back(1980)', 'The Lord of the Rings: The Fellowship of the Ring(2001)', 'One Flew Over the Cuckoo\'s Nest (1975)', 'Inception (2010)', 'Goodfellas (1990)', 'Star Wars (1977)', 'Seven Samurai (1954)', 'Forrest Gump (1994)', 'The Matrix (1999)', 'The Lord of the Rings: The Two Towers (2002)', 'City of God (2002)', 'Se7en (1995)', 'The Silence of the Lambs (1991)', 'Once Upon a Time in the West (1968)', 'Casablanca (1942)', 'The Usual Suspects (1995)', 'Raiders of the Lost Ark (1981)', 'Rear Window (1954)', 'It\'s a Wonderful Life (1946)', 'Psycho (1960)']

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
var ul = $("<ul></ul>");

$.each(movies, function(count, item) {
  ul.append('<li>' + item + '</li>');
var div = $("#myDiv").empty(),
    ul = $("<ul></ul>").appendTo(div);

$.each(movies, function(count, item) {
  $('<li>' + item + '</li>').appendTo(ul);

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment