Test chain assignment

JavaScript performance comparison

Revision 2 of this test case created by hackwaly

Preparation code

<script>
  var obj1 = {
    x: 1
  };

  var obj2 = {
    x: 1
  };
 
  var obj3 = {
    x: 1
  };
 
  var obj4 = {
    x: 1
  };
 
  var obj5 = {
    x: 1
  };
 
  var value = 2;
 
 
</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
Chained
obj1.x = obj2.x = obj3.x = obj4.x = obj5.x = value;
pending…
Separate lines
obj1.x = value;
obj2.x = value;
obj3.x = value;
obj4.x = value;
obj5.x = value;
 
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