Ticket #4759 (closed feature: fixed)
a major optimization is possible in sortable()
|Reported by:||mesoconcepts||Owned by:|
found this while writing a patch with WP bug 10021:
Basically, the key optimization was that:
$('foo').sortable( connectWith: 'bar' );
is tremendously slower than:
$('foo').sortable().sortable('option', 'connectWith', 'bar');
and by this, I'm really meaning slower by inordinate amounts of time. Like... by a factor of 5 in my case, with 15 placeholders.
I haven't looked into your code's specific, but I would assume you're running an O(n!) algorithm in there instead of an O(n).
The connectWidth option, when applied to an array of objects, should be ignored, and applied at the very end, once all of the array elements are instantiated. Else, it recursively jQueries the document for the needed elements, and does the same job n! times on the first element.
I'm pretty certain you've similar optimizations to do over in draggable and droppable, and possibly other areas.
comment:2 Changed 5 years ago by scott.gonzalez
- Priority changed from critical to major
- Type changed from bug to feature
comment:5 Changed 4 years ago by jdmarshall
comment:6 Changed 4 years ago by SpoonNZ
comment:7 Changed 4 years ago by SpoonNZ
- Resolution set to fixed
- Status changed from new to closed