new vs inplace

JavaScript performance comparison

Test case created by panic

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function objDef(x, y, z)
    {
      this.x = x;
      this.y = y;
      this.z = z;
    }
};
</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
new
function testNew() {
  return new objDef(10, 20, 30);
}
pending…
inplace
function testInplace() {
  return ({
    x: 10,
    y: 20,
    z: 30
  });
}
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. Here’s a list of current revisions for this page:

0 comments

Add a comment