Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#4410 closed enhancement (notabug)

Super major speed enhancement for sortable with large lists

Reported by: cardmagic Owned by:
Priority: major Milestone: 1.8
Component: ui.sortable Version: 1.7.1
Keywords: speed performance sortable Cc:
Blocked by: Blocking:

Description

After much digging around, I found a mis-placed call to _refreshItems which significantly slows down sortables with large numbers of items. _refreshItems does not need to be called during the movement of items as it is currently, but rather it should be called as soon as it has reached a new location. Attached is a patch.

Attachments (1)

speed.patch (970 bytes) - added by cardmagic 11 years ago.
Correct patch file

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by cardmagic

Found a bug in speed.patch... but found a work-around... will submit shortly as speed2.patch

Changed 11 years ago by cardmagic

Attachment: speed.patch added

Correct patch file

comment:2 in reply to:  1 Changed 11 years ago by cardmagic

Replying to cardmagic:

Found a bug in speed.patch... but found a work-around... will submit shortly as speed2.patch

When someone moved the refreshItems call to mouseCapture, it seriously slowed down the entire repositioning, so I moved it back to the _mouseStart method.

comment:3 Changed 11 years ago by cardmagic

Instead of naming the patch speed2.patch, I just replaced speed.patch with the correct patch file

comment:4 Changed 10 years ago by Jörn Zaefferer

Milestone: TBD1.8

Performance improvements are welcome. Patch needs testing.

comment:5 Changed 10 years ago by paul

Resolution: invalid
Status: newclosed

Patch isn't working, since this move from mouseCapture to mouseStart heavily destroys some functionality: If you add new elements to a sortable list, say via an ajax call, they're automatically valid draggables because of the check being there in mouseCapture already - if it wouldn't, they wouldn't be considered a target, and therefore the drag fails.

Note: See TracTickets for help on using tickets.