Ticket #2528770 (accepted defect)

Reporter


Garrett Conaty
Opened: 04/12/10
Last modified: 09/19/12
Status: accepted
Type: defect

Owner


Dav Glass
Target Release: BACKLOG
Priority: P3 (normal)
Summary: Sortable performance decays linearly with more elements
Description:

Test case is the sortable-multi-full.html example. Modify that to have about 40 list elements. The drag operations stutter worse the more elements in the list. Doing a quick 'perf' with Firebug, it
looks like most of the time is being spent in the allById method as part of the test() call chain.

However, dynatrace (which I've found much more accurate for perf) reports that nearly all the time is being spent in offsetHeight, offsetWidth, and getBoundingClientRect (which would explain the
painting issues).

Tracing a bit more this seems to be in the check to '_handleTargetOver' via a Y.each which could explain the performance degrading (linearly) with more elements.

Type: defect Observed in Version: 3.1.0
Component: Sortable Severity: S3 (normal)
Assigned To: Dav Glass Target Release: BACKLOG
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: Firefox 3.x - Mac,IE 7.x
URL:
Test Information:

Test environment is an octo-core Mac Pro.

Change History

Garrett Conaty

Posted: 04/14/10

Debugged and hopefully gleaned some more information. Looks like for a typical drag/drop case, _activateTarget does cache the region for the drop targets and that cache is used in the intersect on the dropMove.

However, Y.DD.Delegate sets 'useShim' to false for all of its subnodes, so when sizeShim gets called as part of _activateTarget, no data is cached. For this example, this forces the region to be calculated on all LI elements on EACH mousemove.

Perhaps the optimization would be to cache the region of the delegates anyhow, and then detect if there have been any structure changes (DOM insertion, css, etc.) and recreate the cache.

I believe that the first sortable example actually did this via syncActiveShims, though it seems it would only have to occur when items in any list are 'bumped' out of the way as part of the drag operation.

Dav Glass

Posted: 04/16/10
  • location changed to Library Code
  • milestone changed to 3.2.0
  • priority changed to P3 (normal)
  • status changed from new to accepted

Dav Glass

Posted: 05/10/10

Dav Glass

Posted: 05/10/10

Refs #2528770 - Added some code to make drop targets faster, I can now use 500 sortable items with decent performance
View Commit:

Dav Glass

Posted: 05/10/10

Refs #2528770 - Added some code to make drop targets faster, I can now use 500 sortable items with decent performance
View Commit:

Dav Glass

Posted: 06/29/10
  • milestone changed from 3.2.0 to 3.3.0

Dav Glass

Posted: 10/14/10
  • browser changed from Firefox 3.x - Mac,Safari 3.x - All,IE 7.x to Firefox 3.x - Mac,IE 7.x
  • milestone changed from 3.3.0 to 3.NEXT

Greg Hinch

YUI Contributor

Posted: 12/31/11

Just commenting to bump this for priority I hope. Here are a couple fiddles to compare jQuery Sortable vs. YUI 3.4.1 Sortable. In IE7, the YUI one is noticeably slower.

jQuery - http://jsfiddle.net/SMMVS/
YUI - http://jsfiddle.net/rzKZV/

Jenny Donnelly

YUI Developer

Posted: 09/19/12
  • milestone changed from 3.NEXT to BACKLOG

Moving from 3.NEXT to BACKLOG.