jQuery.each vs. for loop (v272)

Revision 272 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-2.0.3.min.js">

</script>
<script>
  var a = $('*').get(),
      e = {
           name:'test'
      };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
for loop
for (var i = 0, len = a.length; i < len; i++) {
  e.name = a[i];
};
 
ready
jQuery.each
$.each(a, function(i, el) {
  e.name = el;
});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.