Improved thumbnailing performance in Thunar/tumbler

Jannis Pohlmann jannis at xfce.org
Mon Feb 7 22:35:32 CET 2011


Hi folks,

I pushed a branch to git today that dramatically improves the
thumbnailing performance in Thunar:

  http://git.xfce.org/xfce/thunar/log/?h=jannis/thumbnailer-improvements

At the moment, Thunar generates thumbnail requests whenever an item is
being rendered on the screen. This happens a lot even when the item is
only visible for a very short time (like when scrolling very fast).

This would be ok if the thumbnail requests didn't interfere with
Thunar's main loop so much. But they do since all the (grouped) requests
and (individual!) replies are received in the main loop and not by a
worker thread. So that's really bad. 

Nick and I did some thinking about this at FOSDEM and on the train back
I started implementing our idea. It is described here:

http://wiki.xfce.org/releng/4.10/roadmap/thunar#improve_tumbler_integration

Basically, it only generates a request when either the view size or the
current folder changes or when the items that are visible have been
visible already for a short time (175ms at the moment). So we do not
send request while the user is scrolling and we *always* cancel
requests as soon as scrolling starts again and also when the view size
or folder changes. This is much better than anything we had in the past
actually!

We now also clean up the thumbnail cache (~/.thumbnails) by deleting
thumbnails when their corresponding original files are deleted. And we
copy and move thumbnails when their original files are copied or moved.
This way we don't have to regenerate the thumbnails unless files are
replaced or their contents change. This also works with linking, not
just copying and moving.

Please give this branch a bit of testing. Perhaps (but just perhaps) we
can backport it to 4.8 as well. But it's a rather complex modification,
so it really needs to be tested well (and with lots of files and all
kinds of surprising user actions ;)).

Cheers,
Jannis



More information about the Xfce4-dev mailing list