jquery-each

Benchmark created by redfield on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Setup

var array = [];
    for (var i = 0; i < 100000; i++) {
      array.push(i);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Traditional
var sum = 0
for (var i = 0; i < array.length; i++) {
  sum += array[i];
}
console.log(sum);
ready
jQuery.each
var sum = 0;
jQuery.each(array, function(i, e) {
  sum += e;
});
console.log(sum);
ready

Revisions

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

  • Revision 1: published by redfield on