Looping testing
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var l = 1e3, values = [];
while (l--) {
values.push(Math.random() * 1e4);
}
function process (i) {
i*=2;
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
//for loop |
|
pending… |
//do-while loop |
|
pending… |
//while loop |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments