Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • ristretto ristretto
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 34
    • Issues 34
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • AppsApps
  • ristrettoristretto
  • Merge requests
  • !31

Optimize directory loading

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Gaël Bonithon requested to merge Tamaranch/ristretto:optimize-directory-loading into master Oct 02, 2021
  • Overview 0
  • Commits 5
  • Pipelines 6
  • Changes 8

Testing phase.

Fixes #20 (closed) primarily, but also fixes #37 (closed) (see #37 (comment 38056)), and fixes #22 (closed) since progressive loading is removed. Also drastically reduces the problem for #32 (closed) (see #32 (comment 38052)).

This MR allows to gain an order of magnitude in the overall complexity of the directory loading process (scanning the directory, adding files to the list, adding images to the thumbnail bar, clearing the thumbnail bar between two loads), by decreasing it from quadratic to linear.

But this is only an upper bound, because in detail (see the messages of the concerned commits), some steps go from O(n) to O(1) (especially where there were a lot of disk accesses) and the constants in these evaluations are globally improved.

In practice, a directory of 10,000 files that was almost impossible to load on a small laptop like mine, now loads in a few seconds the first time, and in a second the second time (probably because of the disk cache). In accordance with the linear complexity, a directory with 20,000 files loads in about two seconds, and a directory with 30,000 files in about three seconds.

An optimization is also made to the thumbnail bar drawing and the requests to Tumbler, which also greatly improves the smoothness of the thumbnail bar scrolling for these large image numbers.

Edited Oct 07, 2021 by Gaël Bonithon
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: optimize-directory-loading