Ticket #6547 (closed enhancement: invalid)
jQuery.each has unnecessary property lookups which are a hindrance to performance
|Reported by:||fitzgen||Owned by:||fitzgen|
I improved the performance of $.each while iterating over objects by storing object[ name ] in a local variable in the loop.
I ran the following to show myself that it was in fact faster with the local variable:
FF 3.5 before: 4621 ms FF 3.5 after: 4186 ms
Chromium 5.0.391.0 before: 331 ms Chromium 5.0.391.0 after: 307 ms
The relevant commit is this one: http://github.com/fitzgen/jquery/commit/6e61c0ae03dbca67e3938fda6db61b297109777b
Thanks! jQuery is awesome!
- Keywords speed each added
- Priority set to low
- Status changed from new to open
- Milestone changed from 1.4.3 to 1.5