Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReloadImageList is sub-optimal #585

Closed
fire-eggs opened this issue Jul 19, 2019 · 1 comment
Closed

ReloadImageList is sub-optimal #585

fire-eggs opened this issue Jul 19, 2019 · 1 comment

Comments

@fire-eggs
Copy link
Collaborator

Windows 10 -> viewing images in a folder across the network.
"Include child folders" is ON.
The folder in question had 22,184 files and 317 folders.

Behavior:

  1. Ran IG.
  2. Opened an image at the top of the tree.
  3. IG showed images and could be used in 1 second or so.
  4. Goto settings, change sort order. [Sufficient to switch sort-by-name from Ascending to Descending, or visa-versa]. Save and exit.

At this point, ImageGlass takes 12+ seconds to come back to life.

Running Performance Profiler, the CPU hotspot identified is GetDistinctDirsFromPaths. Specifically, the call to File.Exists().

Debugging:
A. On the initial call, GetDistinctDirsFromPaths is given a single path, the original single file opened.
B. On the second call (as invoked from ReloadImageList), GetDistinctDirsFromPaths is given a pathlist containing every file in the image list!

File.Exists() is a relatively expensive call, especially across the network.

A simple resort of the existing list should not require a full verification of every single file and path.

@d2phap d2phap added this to the v8.5 milestone Apr 12, 2022
@d2phap d2phap removed this from the v8.6 milestone May 28, 2022
@d2phap d2phap added this to the v9.0 beta 4 milestone Feb 24, 2023
@d2phap
Copy link
Owner

d2phap commented Apr 14, 2023

Fixed this in v9.0 beta 4

@d2phap d2phap closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants