Generate file thumbnails before folder thumbnails
AbandonedPublic

Authored by broulik on Aug 12 2018, 2:52 PM.

Details

Reviewers
elvisangelaccio
Group Reviewers
Dolphin
VDG
Summary

File thumbnails are usually a lot more prominent and quicker to be generated. We shouldn't stall generating the file thumbnails on generating some tiny folder thumbnails that might take a while since it may recurse into subdirectories.

Test Plan
  • Opened my pictures folder, had my picture thumbnails show up immediately, it took a couple of seconds, though, for it to start generating the folder thumbnails again, so not sure if this is optimal?

Diff Detail

Repository
R318 Dolphin
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Aug 12 2018, 2:52 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptAug 12 2018, 2:52 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
broulik requested review of this revision.Aug 12 2018, 2:52 PM

Is this about generating the thumbnails for the first time or displaying them?

broulik updated this revision to Diff 39554.Aug 13 2018, 7:53 AM
  • Use stable_partition so the order of elements is preserved

Is this about generating the thumbnails for the first time or displaying them?

Both. Generating takes obviously longer but it still takes a split second to load the thumbnail even if it is cached

abetts added a subscriber: abetts.Aug 13 2018, 8:00 AM

What would be an example of this? Any graphics to see?

Just gave this a try on my pictures folder, with "Folders first" turned on (it's the default setting). Observations:

  • In a folder with a small number of sub-folders and a large number of images, it's nicer, since the fime thumbnails show up faster
  • In a folder with a medium number of sub-folders, it's tiny bit odd but mostly fine.
  • In a folder with a large number of sub-folders (more than will fit on the screen at once), it's very odd since it looks like nothing it happening for a few moments.

Just gave this a try on my pictures folder, with "Folders first" turned on (it's the default setting). Observations:

  • In a folder with a small number of sub-folders and a large number of images, it's nicer, since the fime thumbnails show up faster
  • In a folder with a medium number of sub-folders, it's tiny bit odd but mostly fine.
  • In a folder with a large number of sub-folders (more than will fit on the screen at once), it's very odd since it looks like nothing it happening for a few moments.

What would happen if the user selects a view mode that is contrary to the arrangement of Folders > Thumbnails and instead arranged the sorting to be Thumbnails (Images) > Folders ? Would this mean that folders load first still?

Just gave this a try on my pictures folder, with "Folders first" turned on (it's the default setting). Observations:

  • In a folder with a small number of sub-folders and a large number of images, it's nicer, since the fime thumbnails show up faster
  • In a folder with a medium number of sub-folders, it's tiny bit odd but mostly fine.
  • In a folder with a large number of sub-folders (more than will fit on the screen at once), it's very odd since it looks like nothing it happening for a few moments.

What would happen if the user selects a view mode that is contrary to the arrangement of Folders > Thumbnails and instead arranged the sorting to be Thumbnails (Images) > Folders ? Would this mean that folders load first still?

This makes folders load last, not first. There is no "thumbnails before folders" mode, but there is a mode to intersperse folders within files (the way macOS finder does by default). In this mode, the change is much less noticeable.

Just gave this a try on my pictures folder, with "Folders first" turned on (it's the default setting). Observations:

  • In a folder with a small number of sub-folders and a large number of images, it's nicer, since the fime thumbnails show up faster
  • In a folder with a medium number of sub-folders, it's tiny bit odd but mostly fine.
  • In a folder with a large number of sub-folders (more than will fit on the screen at once), it's very odd since it looks like nothing it happening for a few moments.

What would happen if the user selects a view mode that is contrary to the arrangement of Folders > Thumbnails and instead arranged the sorting to be Thumbnails (Images) > Folders ? Would this mean that folders load first still?

This makes folders load last, not first. There is no "thumbnails before folders" mode, but there is a mode to intersperse folders within files (the way macOS finder does by default). In this mode, the change is much less noticeable.

Awesome! :D

Did you check the updated version with stable_partition? It makes the folders generate in the correct order as well.

Yes, I used the latest version of the patch. My comments are still:

  • With folders interspersed within the files: big improvement
  • With folders first:
    • Small number of sub-folders: big improvement
    • Medium number of sub-folders: a wash
    • Enough sub-folders so that you need to scroll to see any files: regression since it seems for a moment that nothing's happening

FWIW on my fast SSD-based machine, it's all mostly a wash, as the thumbnails are displayed almost faster than I can notice.

Perhaps, could we only opt in to this behavior when the number of sub-folders is below some threshold? That would eliminate the only minor regression. Even better if that threshold could be dynamically determined and correspond to "a number equal to how many items can appear in the current window". In other words, we should not do this there are folders and files, but only folders are visible (because then it looks like nothing is happening for a moment).

broulik abandoned this revision.Oct 10 2018, 2:04 PM