fredcw/Notes

Search delay in cinnamenu

fredcw opened this issue · 4 comments

Search delay in cinnamenu

@Draconicrose The following info might help me fix this. Do you have a particularly large number of files in a folder or a particularly complex directory structure in your home folder (excluding hidden folders)? What hardware is your home folder stored on, mechanical HD, SSD, flash drive etc? Thanks.

Let me see if I can answer that.

  • Home folder is not complex, mostly top level folders with one or two sub-folders.
  • My largest non-hidden folder is 68,2 GB
  • Home folder is stored on an HDD

Now, I so have one folder which has links to another folder which is on an SSD drive. Unsure if that could cause an issue?

Thanks, I did a test with a large number of files in one directory (40,000+ files) which caused a delay 1-2 on my ssd. This is the only part of the code that I think may be causing the delay. Also, this delay may be more on a mechanical HD because of the seek time and if the folder contents are not currently in the disk cache. What I'll do is put a maximum time limit of 200ms to search each folder. This may mean that the search function may not find all file matches in large folders but on subsequent searches, it should work because the info should be in the read cache.

If you want to test this fix you can replace line 1178 in ~/.local/share/cinnamon/applets/Cinnamenu@json/4.0/applet.js

It should be:

while (next) {

replace it with:

let searchTimeLimit = Date.now() + 200;
while (next && Date.now() < searchTimeLimit) {

save and restart cinnamon
Hopefully this will fix it.

It does make sense that the HDD might be the bottleneck.

I've tried your fix. I can still notice a slight hiccup but it's MUCH better and definitely less intrusive than before.

Thank you!