jani-iterating arrays
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>
<script>
Benchmark.prototype.setup = function() {
var src = [];
for (var i = 0; i < 5000; i++) {
src.push(i);
}
var cv,ci;
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
mootools each |
|
pending… |
mootools each without index |
|
pending… |
for easy |
|
pending… |
for easy without index |
|
pending… |
for |
|
pending… |
for without index |
|
pending… |
while |
|
pending… |
while without index |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments