pczeglik-simple-test

JavaScript performance comparison

Test case created by pczeglik

Preparation code

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

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
forup
for (var i = 0; i < a.length; i++) {
    a[i];
}
pending…
fordown
for (var i = a.length -1; i = 0 ; i--) {
    a[i];
}
pending…
forupbetter
var i = 0, j = a.length;
for (; i < j; i++) {
    a[i];
}
pending…
fordownbetter
var i = a.length - 1;
for (; i = 0 ; i--) {
    a[i];
}
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