reverse loops

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    case = ['radiohead', 'jeff', 'sigur ros', 'hammock', 'eluvium', 'mono', 'mogwai', 'olafur', 'hello destiny', 'cool things', 'between the buried and me', 'this will destroy you'];
};
</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
1
for(var i = case.length; i--;){

}
pending…
1.2
var cache = case.length
for(var i = cache; i--;){

}
pending…
1.3
var cache = case.length
for(var cache; cache--;){

}
pending…
2
for(var i = case.length; i-- > 0;){

}
pending…
2.2
var cache = case.length
for(var i = cache; i-- > 0;){

}
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