array-vs-fake-array

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a = [], b = {}, c = new Float32Array(10000);
};
</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
real array
for (var i = 0; i < 10000; i++) {
  a[i] = i;
}
pending…
fake array
for (var i = 0; i < 10000; i++) {
  b[i] = i;
}
b.length = 10000;
pending…
Typed Array
for (var i = 0; i < 10000; i++) {
  c[i] = i;
}
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