Modify ↓
Ticket #5921 (closed enhancement: worksforme)
nextUntil to slow (possibly all *Until functions)
| Reported by: | szopen | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | core | Version: | 1.4 |
| Keywords: | nextUntil, slow | Cc: | |
| Blocking: | Blocked by: |
Description
I've done some superficial speed tests that could be found at http://pastebin.com/f561045be
It turns out, that possibly nextUntil isn't as fast as it could be. See pastebin or attachment for details.
For example the code
var obj = $(this).parent().children();
var start = obj.index(this) + 1;
var end = obj.index($(this).nextAll('h1:first'));
if ( end == -1 ) {
slice = obj.slice(start);
} else {
slice = obj.slice(start,end);
}
is ~3 times faster than
slice = $(this).nextUntil('h1');
I suggest to perform some more tests, especially on large data sets. I suggest on making some more tests esp. on larger data sets.
Attachments
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

