Shopify/batman — Issue #197: Sorting moderately sized Sets is expensive
Author: pvande
Created: 2011-10-26 02:39:08+00:00
State: open

jsFiddle: http://jsfiddle.net/jfu7U/

(This is a set of data of about the size *I'm* considering "moderate". Many of these details reproduce with much smaller lists.)

* Sorting blocks user interaction.
* Sorting effectively replaces the DOM.Iterator, sometimes causes a flash of empty content.
* Sorting gets progressively slower.
* Memory consumption grows with each sort.

These problems grow worse as the complexity of the `foreach` node goes up; similarly, the complexity of the iterated data. Pagination is not a solution -- the entire set needs to be in memory to be sorted client-side, and sorting server-side means equally significant latency, in addition to (potentially) more common binding replacements, and (eventually) still storing the entire set client-side (though never benefitting from having the data locally cached).