Linked list vs array

JavaScript performance comparison

Revision 4 of this test case created by Jamie Hill

Preparation code

var Obj = function(a){ this.a = a; };

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 arr = [];
arr.push(new Obj(1));
arr.push(new Obj(2));
arr.push(new Obj(3));
arr.push(new Obj(4));
arr.push(new Obj(5));
arr.push(new Obj(6));
arr.push(new Obj(7));
arr.push(new Obj(8));
arr.push(new Obj(9));
arr.push(new Obj(10));
var head = new Obj(1), o;
o = ( = new Obj(2));
o = ( = new Obj(3));
o = ( = new Obj(4));
o = ( = new Obj(5));
o = ( = new Obj(6));
o = ( = new Obj(7));
o = ( = new Obj(8));
o = ( = new Obj(9));
o = ( = new Obj(10));

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