rhermann69

JavaScript performance comparison

Test case created by christian-beckmann

Preparation code

<script>
var markers = [];
for(let i = 0; i < 10000; i++) {
markers.push({i: i});
}
</script>
    

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
for1
for (let i = 0; i < markers.length; i++) {
     let marker = markers[i];
}
pending…
for2
for (var i = 0, len = markers.length; i < len ; i++) {
     let marker = markers[i];
}
pending…
while1
var i = -1;
while(++i<markers.length) {
     let marker = markers[i];
}
pending…
while2
var i = 0;
while(i<markers.length) {
     let marker = markers[i];
++i;
}
pending…
for of
for (let marker of markers) {

}
pending…
for in
for (let i in markers) {
     let marker = markers[i];
}
pending…
foreach
markers.forEach((marker) => {

})
pending…
map
markers.map((marker) => {

});
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