2d-array vs. object
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var len = 1000;
var string = "";
var array1= new Array(len);
for (var i = 0; i < len; i++) {
array1[i] = new Array(len);
}
var array2 = new Array(len * len);
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
two_dimensional |
|
pending… |
string |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments