find function slower since 1.9.0, especially in chrome
|Reported by:||ktmitton@…||Owned by:||dmethvin|
I noticed when selecting a large array of elements (in my case 11,000+), the jQuery find function would perform much slower in 1.9.0 than in previous versions of jQuery. Looking into the code, it looks like the function was rewritten to use the jQuery.unique function, which was actually mapped to Swizzle.uniqueSort.
It turns out the actual sorting part of the function:
results.sort( sortOrder );
is where the slowdown occurs. I tested in Firefox and IE as well, and the slowdown wasn't as noticeable, but in chrome this added 5-10 seconds to the find.
I created a jsFiddle test http://jsfiddle.net/E6gPN/6/ that creates 12,000 options, runs the find, and outputs the amount of time it took to execute the find.
Change History (6)
comment:3 Changed 4 years ago by dmethvin
- Component changed from unfiled to traversing
- Milestone changed from None to 1.9.1
- Owner set to dmethvin
- Priority changed from undecided to high
- Status changed from open to assigned
comment:4 Changed 4 years ago by Dave Methvin
- Resolution set to fixed
- Status changed from assigned to closed