Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
jQuery Each vs For long array
(version: 1)
Comparing performance of:
jQuery Each vs For
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Script Preparation code:
var test = ['fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum','fe', 'fi', 'fo', 'fum',];
Tests:
jQuery Each
$.each(test, function (ind, val) { console.log(val); });
For
for(var i = 0, j = test.length; i < j; i += 1){ console.log(test[i]); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
jQuery Each
For
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
jQuery Each
2603.1 Ops/sec
For
3017.9 Ops/sec
Related benchmarks:
jQuery.each() vs Array.prototype.forEach()
ArrayFind
array test 123123123123
Array.from vs Array spread with mapping of values2
find() vs for...of vs for-loop BIG
jQuery.each() vs Array.prototype.forEach() vs _.each()
test jsss
spread vs concat vs unshift Big string array
jQuery $.each() vs Array.prototype.forEach()
Comments
Confirm delete:
Do you really want to delete benchmark?