loop descendening
JavaScript performance comparison
Info
check if --i>=0 is faster then i--
Preparation code
<script>
var arr = (function() {
var i = 0,
ret = [];
while (i++ < 100000) {
ret[i] = i;
}
return ret;
})();
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
i-- |
|
pending… |
--i>=0 |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments