Private scoping speed test

JavaScript performance comparison

Test case created by David Rodrigues

Preparation code

<script>
  function private_cache(a) {
    return a * 10;
  }
</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
External method
for(var i=0; i<10; i++)
  private_cache(i);
pending…
Anonymous method
for(var i=0; i<10; i++)
  (function(i){
    return i * 10;
  })(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