array access versus object access
JavaScript performance comparison
Preparation code
<script>
var a = [];
for (var i = 1000; i--; ) { a.push(i); }
var b = { a: 'aoue', b: 'baoelu', c: 1239012 }
var c = [a,b];
var array = [a,b,c];
var object = {a:a, b:b, c:c};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
array |
|
pending… |
object |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments