rock vs bar

JavaScript performance comparison

Test case created by pop

Preparation code

  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;

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();
rock create
var otherRock = Object.create(Rock.prototype);;

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

Compare results of other browsers


Comment form temporarily disabled.

Add a comment