rock vs bar

JavaScript performance comparison

Test case created by pop

Preparation code

<script>
  var Thing = function () {
    this.hasMass = true;
  };
  Thing.prototype = { holy: 'object', batman: '!' };
  Thing.prototype.constructor = Thing;
 
  var Rock = function () {
    this.hard = 'very';
  };
  Rock.prototype = new Thing();
  Rock.constructor = Rock;
 
 
</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
rock - new
var newRock = new Rock();
 
pending…
rock create
var otherRock = Object.create(Rock.prototype);
Rock.call(otherRock);
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