map/filter vs foreach
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var a = Array(100000);
var i;
for (i=0; i<100000; i++) { a[i] = i; }
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
map/filter |
|
pending… |
for loop |
|
pending… |
foreach |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments