Array Zero Fill

JavaScript performance comparison

Revision 11 of this test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
t1
var len = 1000;

var arr = new Array(len);
while (len-- > 0) {
          arr[len] = 0;
}
pending…
t2
var len = 1000;

      var arr = new Array();
      while (len-- > 0) {
          arr[len] = 0;
      }
pending…
t3
var len = 1000;

      var arr = new Array(len);
      for (var i = 0; i < len; i++) {
          arr[i] = 0;
      }
pending…
t4
var len = 1000;

      var arr = new Array();
      for (var i = 0; i < len; i++) {
          arr[i] = 0;
      }
pending…
t5
var len = 1000;

      var arr = new Array(len);
      for (var i = len; i > 0; i--) {
          arr[i] = 0;
      }
pending…
t6
var len = 1000;

      var arr = new Array();
      for (var i = 1000; i > 0; i--) {
          arr[i] = 0;
      }
pending…
Typed
var len = 1000;
var arr = new Uint32Array(len);
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