-
Notifications
You must be signed in to change notification settings - Fork 309
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
Nemo 4.4.2 thumbnailing performance #2291
Comments
I've been messing with this on and off for a while (and have quite a few heavily populated pic folders polluting my disk space) - one optimization I'm looking at is how the icon view layout and spacing changes as thumbnails are generated. Currently if you have a row of short images, once they get thumbnailed (and their placeholder image is replaced), their position relative to the row above them can be adjusted to keep spacing to a minimum. This can happen a great deal in a large folder, and even more depending on the zoom level and width of the window. I've made a branch recently: #2289 - it uses a strictly fixed spacing between icons - meaning, there is no optimization for image height - spacing is based on the current zoom level's icon size. This seemed to have a noticeable effect on loading time (in a folder that hasn't been previously thumbnailed), as well as an observable reduction in cpu time. Some data: https://www.dropbox.com/sh/3xsn90kq4unr3u3/AADB4QWUvMxU9EeNAu7ZvSEka?dl=0 - I'm no expert on this type of analysis, but it has become a useful tool. The graphs are slightly interactive if you load them directly in a browser. When testing this stuff, I also clear the disk cache to take it out of the equation:
I'd be curious about your observation with the pull request - it's not a finished thing, just using it to work out ideas on how to improve this situation. I'll make deb package if you want. I did actually go back to working on this after your last issue during the beta, though this can be a big time sink with little reward and there were other priorities. At the time I wasn't too surprised at some of the outcomes you had - with only 2gb ram and little swap space, it was inevitable you were going to run out of memory. |
Thanks @mtwebster - I guessed it would probably still be on your radar but thought some actual data would still be helpful. I'll take a look at building from the test branch and seeing how it helps. I thought I'd have a look at how pix deals with the 5000 pic folder. Pretty well as it turns out. I emptied the thumbnail cache before firing up pix. It thumbnailed the whole folder within a couple of minutes, remained responsive throughout, and does a good job of prioritising thumbnails for files currently in view very quickly. Still demonstrates quite high memory usage once all thumbnails are loaded, but with the memory available on this hardware this doesn't seem to impact it's performance. Not sure if there is anything it the way that pix does things that could be ported into nemo?
|
If you want something else to try :) This uses a more modern thumbnailing code from gnome's 'gnome-desktop' library. I've been considering backporting it. It seems to take a bit longer to thumbnail everything, but possibly uses less cpu doing so. I have barely tried it yet, just sharing if you're interested. |
I'll do some testing of both during the course of this week. Sorry I mean't to ask before is there any debugging commands that might help work out what nemo is doing when it is unresponsive on displaying the 5000 pic folder of already thumbnailed images? In my test above although nemo's memory use was high at that point the system wasn't using swap. Eliminating that unresponsiveness I think would go a long way to improving the end user experience. |
Hi - observations with the test-icon-space branch and the 5000 image folder.
Overall this is a good improvement - if nothing else because nemo didn't lock up indefinitely at any point and everything is a bit faster and used a little less RAM. The aesthetics aren't so great particularly for 16:10 images in portrait, but personally that wouldn't bother me. |
Observations with the gnome-thumbnail-lib branch and the 5000 image folder.
|
Hello, I am using nemo-4.4.2-1.fc30.x86_64 (Fedora 30 spin). I have similar problems as described above, but with considerably less number of images in a folder. For example, a folder with 600 images makes nemo completely freeze during thumbnail generation. I noticed the following things:
Ideally, it would be nice if nemo could see how many cpu cores are available and fork several thumbnail generators, independent of the main nemo process showing the folder GUI. Care should be taken not to fork too many times, I've seen people set a limit, like use half the cpu cores when there are more than two, but use only one when less than two, etc. Since nemo kept freezing, I installed nautilus, which is more efficient and has no problems generating thumbnails.
|
Now that I have a Biggest annoyances:
I'm not sure what the issue is with |
I'm working on some improvements that should hopefully make it into the next release. The performance bump in most instances is pretty significant. it's here if you wanted to try it: #2341 (It's by no means complete or perfect yet but it's reasonably useable). |
In the words of my people: "You bloody ripper!" That's amazing, simple fantastic! I've tried and failed to browse large folders in nemo many times and watched it struggling to load and thought "If it just had a fixed vertical spacing layout and only loaded the thumbnails in view, it would load so much faster". Dude, mtwebster, you're my hero today, thankyou, brb need to go find the LM donate page.. |
@mtwebster this is amazing! I just compiled it and it and installed it and it's noticeably faster. Thank you! |
I can say the same. The performance while browsing my worst-case directory (~5400 smartphone jpegs) improved significantly when thumbnails are enabled! Thank you @mtwebster But I'm experiencing this: I open one file via double-click so it's shown using xviewer. Then I close xviewer again, double-click a second file and nothing happens for a couple of seconds. It looks to me like the "double-click event" gets delayed for a few seconds. Because after those seconds the file gets selected/opened without problems. Maybe someone else has the same behaviour? I am using Linuxmint 19.3 and only built nemo from source to help solving this thumbnailing performance issue. |
@andoo I cannot replicate your issue. If I enter a large folder with several thousand images, I can double-click on any of them and they open instantly. Even after closing the Xviewer, they open instantly again. nemo - latest git; cinnamon 4.6.0. |
I somehow forgot to mount my filesystems with noatime... I believe that this stopped the recreation of already created thumbnails. But this event delay is still persistant. Not when I just opened the folder. But after scrolling through it in icon view (after loading/showing more than 1000 thumbnails). I think it's a related problem due to the amount of files/thumbnails. But the thumbnailing performance itself improved alot. I'm a happy nemo user again! |
@andoo I experience the same issue. For me it happens even with folders with ~300 image (and video) files. Not only does double clicking take 3-4 seconds, but using the keyboard keys and hitting Return to open up a new image also has the same delay. I also noticed that throughout the 'waiting period' the CPU usage spikes to 100% |
Just wanted to come back and leave some more feedback on these changes, with LM20's version of Nemo, now even on my slowest laptop, I am able to navigate folders with over 15,000 images in them. Before Nemo on that same laptop was so slow it would lock up and crash even trying to view folders with less than 1/10th of that number of files. So the performance difference is MASSIVE. Thankyou so much for persisting with this and for improving it, it's made a huge difference. Now I can finally uninstall Caja and use Nemo all the time! |
This continues to happen with me as well, same version of Mint and Nemo. I even disabled thumbnails entirely, disabled all extensions. Here is a forum post for reference: |
I'm also experiencing the UI freezes and lag when working with folders containing dozens to hundreds of images. There is definitely a thread stuck using 100% of one CPU core when these freezes occur. Another clue: typically they don't start happening right away, only after I've done some number of operations with the files, moved between various folders, etc. Once the problem becomes noticeable, it tends to get worse and worse until I kill nemo - which will not close and has to be killed when stuck at 100% CPU. This is with version 4.6.5 on Mint 20. |
I just commented here about my thumbnails problem with a folder of 120,000 small files. |
I have an open merge request for concurrent thumbnailing in nautilus. Perhaps this could be ported to nemo. |
This has been on our todo list for while, but haven't had a chance. I'll take a look at it, thanks. |
The test machine
Issue
I reported during the beta Nemo being killed by the OOM controller whilst thumbnailing a folder of 21K image symlinks on a limited ram (2GB) virtual machine and have noted thumbnailing related performance issues for sometime. Several open issues regarding nemo peformance in general I think are related to thumbnailing and also memory use of nemo when navigating folders which large numbers of already thumbnailed images. I thought it might be helpful to try and benchmark some behaviour. These tests are done on the host machine specs above. The folders are on the SSD.
Test 1 - Thumbnail generation on a folder of 1000 jpg images in icon view at maximum zoom
Directory info
Baseline ps aux output for nemo after running
nemo -q; nemo
Then quit nemo, cleared the thumbnail cache and restarted nemo directly on the target folder.
Nemo remained responsive and allowed me to scroll up and down the folder a little during thumbnailing.
ps aux output for nemo having thumbnailed all pics
ps aux output for nemo having navigated back to parent folder
ps aux output for nemo displaying the thumbnailed folder again.
Load times on 2nd view
Then quit nemo and reopened.
ps aux output for nemo displaying the thumbnailed folder from a fresh start
I then had a quick look at the thumbnail cache and notes that the time difference between the first and last thumbnail produced was 1m 34 seconds.
Test 2 - Thumbnail generation on a folder of 5000 images
Directory info
Then quit nemo, cleared the thumbnail cache and restarted nemo directly on the target folder.
ps aux output for nemo having thumbnailed all pics
Thumbnailing took about 13 minutes. Nemo became unresponsive towards the end of the process and didn't recover so I was forced to
nemo -q
I then reloaded the folder.
ps aux output for nemo displaying the thumbnailed folder from a fresh start
There was no lockup this time so I navigated to the parent folder and back again
ps aux output for nemo having navigated back to parent folder
Loading of the pics folder was excessive this time and nemo was unresponsive once loading at finished
ps aux output for nemo displaying the thumbnailed folder again.
I then quit nemo with
nemo-q
and then reopened to check the thumbnail cache. The time difference between the oldest and newest thumbnail was 10m 34 seconds.Test 3 - The effect of toggling thumbnail visibility on an already thumbnailed folder.
I did this test on the 1000 pic directory given the lock-ups experienced just thumbnailing the 500 pic directory. First I opened the directory in nemo and allowed it to complete thumbnailing before quiting nemo. Then opened the folder from a fresh start.
I then toggled thumbnail visibility to off
Then back on. There was quite a lengthy delay before all thumbnails were reloaded.
Noting the increased RAM usage I then toggled off again
And back on
Hopefully this is helpful info in identifying bottlenecks. I was disappointed to find that 5000 pics was enough to lock up nemo entirely as I don't think that is a particularly extreme number of pictures to have in a folder.
I'll keep the the two test folders as is so if there in any further testing that would be helpful let me know.
Related open issues - #2245, #1907
The text was updated successfully, but these errors were encountered: