proto_of_perf

JavaScript performance comparison

Test case created by Russ Powers

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  myProto = {
  double: function(x, y) { return x * y },
  double1: function(x, y) { return x * y },
  double2: function(x, y) { return x * y },
  double3: function(x, y) { return x * y },
  double4: function(x, y) { return x * y },
  double5: function(x, y) { return x * y },
  double6: function(x, y) { return x * y },
  double7: function(x, y) { return x * y },
  double8: function(x, y) { return x * y },
  double9: function(x, y) { return x * y }
  }
  
  var native = Object.create(myProto);
  
  var mc = {
    a: function() { return 100; }
  }
  
  var modded = Object.setPrototypeOf(mc, myProto);

};
</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
Native
native.double(1, 100);
native.double1(1, 100);
native.double2(1, 100);
native.double3(1, 100);
native.double4(1, 100);
native.double5(1, 100);
native.double6(1, 100);
native.double7(1, 100);
pending…
SetProto
mc.double(1, 100);
mc.double1(1, 100);
mc.double2(1, 100);
mc.double3(1, 100);
mc.double4(1, 100);
mc.double5(1, 100);
mc.double6(1, 100);
mc.double7(1, 100);
pending…

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

0 Comments