js loops
JavaScript performance comparison
Info
Checking the real performance difference for the various javascript loops patterns.
Preparation code
<script>
Benchmark.prototype.setup = function() {
var bigArray = [];
var j =0;
for(var i=0; i < 1000; i++){
bigArray.push(i);
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Case 1 |
|
pending… |
Case 2 |
|
pending… |
Case 3 |
|
pending… |
Cached Case 1 |
|
pending… |
Case 4 |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Arash Milani
- Revision 2: published
- Revision 3: published
- Revision 5: published by Fabrice Daugan
- Revision 6: published
- Revision 7: published
- Revision 9: published
- Revision 10: published
- Revision 11: published
- Revision 12: published
- Revision 14: published
- Revision 15: published
- Revision 16: published
- Revision 17: published
- Revision 18: published by Dmitriy
- Revision 19: published
- Revision 20: published by Niels Boehm
- Revision 21: published
- Revision 22: published
- Revision 23: published
- Revision 24: published
3 comments
xxxx
Why Case 1 (not cashed) is faster then cashed case? I do not understand it.
I mean FF 18