shiftindex

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a = [1,2,3,4,5,6,7,8,9,0];
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
index
var b = a[0],
c = a[1],
d = a[2],
e = a[3],
f = a[4],
g = a[5],
h = a[6],
i = a[7],
j = a[8],
k = a[9];
pending…
shift
var b = a.shift(),
c = a.shift(),
d = a.shift(),
e = a.shift(),
f = a.shift(),
g = a.shift(),
h = a.shift(),
i = a.shift(),
j = a.shift(),
k = a.shift();
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment