for-count-inside-and-outside

JavaScript performance comparison

Revision 2 of this test case created by Rinat Valiullov

Preparation code

   <script>

        Benchmark.prototype.setup = function() {

          
  var a=[];
  for(var b=101; b>0; b--){
   a.push(b);
  }

        
  };
          



        Benchmark.prototype.teardown = function() {

          
  a=[];

        
  };

      
</script>
    
    

Preparation code output

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
count inside using op "+="
for(i=0; i<a.length; i+=1){
    //do nothing as we are measuring time based on count var only 
}
pending…

Revisions

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

0 Comments