Typed array iteration

JavaScript performance comparison

Revision 34 of this test case created

Preparation code

<script>
  var static = new Array(500);
  var dynamic = new Array(); //Don't do this
  var unfixed = new Int8Array(); //You really don't want to do this
  var fixed = new Int8Array(500);
</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
Static
for (var ii = 0; ii < 500; ++ii) {
  static[ii] += 1;
}
pending…
Unfixed
for (var ii = 0; ii < 500; ++ii) {
  unfixed[ii] += 1;
}
pending…
Fixed
for (var ii = 0; ii < 500; ++ii) {
  fixed[ii] += 1;
}
pending…
Dynamic
for (var ii = 0; ii < 500; ++ii) {
  dynamic[ii] += 1;
}
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