create or resuse

JavaScript performance comparison

Test case created by Xotic750

Preparation code

<script>
  var a = [0, 0, 0, 0],
      b = {
      0: 0,
      1: 0,
      2: 0,
      3: 0
      };
</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 a
a = [0, 0, 0, 0]
pending…
new b
b = {
  0: 0,
  1: 0,
  2: 0,
  3: 0
};
pending…
reuse a
a[0] = 0;
a[1] = 0;
a[2] = 0;
a[3] = 0;
pending…
resuse b
b[0] = 0;
b[1] = 0;
b[2] = 0;
b[3] = 0;
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