Linked list vs array

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

var Empty = function(){};
var Cons = function(a, List){this._0 = a;this._1 = List};

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
new Cons(1, new Cons(2, new Cons(3, new Cons(4, new Cons(5, new Cons(6, new Cons(7, new Cons(8, new Cons(9, new Cons(10, new Cons(11, new Cons(12, new Cons(13, new Cons(14, new Cons(15, new Cons(16, new Cons(17, new Cons(18, new Cons(19, new Cons(20, new Empty()))))))))))))))))))))

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