Browser Diet - jQuery.each vs. for loop
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
var a = $('*').get(),
e;
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jQuery.each |
|
pending… |
for loop |
|
pending… |
for without caching |
|
pending… |
alternative for loop |
|
pending… |
reverse for |
|
pending… |
while reverse |
|
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 Zeno Rocha
- Revision 2: published
- Revision 3: published by Marcelo Barbosa
- Revision 4: published by jarekps
- Revision 5: published
- Revision 6: published
- Revision 7: published by jarekps
- Revision 8: published
- Revision 9: published
- Revision 11: published by Leny
- Revision 12: published
- Revision 13: published
- Revision 14: published
- Revision 15: published
- Revision 16: published
0 comments