ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Incremental sorting #73

Open kirillt opened 3 years ago

kirillt commented 3 years ago

Right now, sorting of resources causes small delays on huge collections (e.g. 5000 of pictures). After addition of persistence of sorting preferences, this delay is imposed after frequent actions: opening a folder and going back from gallery mode to resources grid.

It may be possible to perform sorting in a smarter way: 1) find top T resources and put K of them into visible frame; 2) spawn sorting of the rest of resources in background; 3) allow the user to do his stuff.

Implementation can be non-trivial, but performance would be better: blocking phase: T * N operations to find top T resources (where N is number of all resources) background phase: normal sorting of N - T elements

kirillt commented 2 years ago

Eventually this should be implemented in the library, but it's not clear when it will be possible.

kirillt commented 1 year ago

Also, lazy shuffling (#15) could be implemented in similar fashion.