calculations after boxing numbers inside an object

JavaScript performance comparison

Test case created by Victor Maia

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  function number(n){
      return {type:'number',parent:undefined,value:n};
  }
  function sum(a,b){
      return {type:'number',parent:undefined,value:a.value+b.value};
  }
  boxed_num = number(0);
  normal_num = 0;

};
</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
normal number sum
normal_num = normal_num + 1;
pending…
boxed number sum
boxed_num = boxed_num + number(1);
pending…

Compare results of other browsers

Revisions

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

0 Comments