Speeding up displaying of files in nautilus


I'd like to propose an optimization for displaying files in nautilus,
specilally when using folders with huge amounts of files.  This
optimization should apply to any kind of file but the problem is
specially worse with images or video files because of the thumbnail

First of all, I'm not an experienced C developer.  Mostly, I am a web
developer but I know a lot of software development in general.

I'll start describing a little overview of the current proccess (It
might be not accurate):
When a user opens a folder with lots of files, let's say images,
nautilus will check if those images are already cached in the
~/.thumbnails directory. If they are not cached, it starts the
thumbnailing proccess and cache the result in the mentioned directory
for later use.  Then nautilus displays the files in the file browser

For files that are not images, let's say documents (OOo, PDF, etc)
nautilus will query the mime database and get the appropiate icon.

I made a test with a folder with ~2200 images of different sizes.  The
first time it will take some time to show the files with an special icon
indicating that it is working in background trying to generate the
thumbnails.  Nowadays the thumbnailer is faster and smarter since it
starts thumbnailing first the images that are visible on the screen. 
Since the progress of this proccess is very visible on the screen there
is no feeling of slowness, however the CPU is working 100% doing the

Now, the worst case is when all the files are cached, when you open the
folder it shows an empty window (and hogging up the CPU) and after
several seconds it shows the full content on the screen.  In fact this
is faster that the previous case but the feeling of slowness is bigger
since there is no feedback.

My proposal is as follows:
When opening the folder for the first time (no cache at all) nautilus
will thumbnail _only_ the files that are visible on the screen and then
cache them in the appropiate place.  As soon as the user starts
scrolling the window nautilus will create the thumbnails of the new
visible files.  Note that the fastness of the thumbnailer are the key
for this aproach.  This will increase the speed and lower CPU

Now, when there are cached data for the images, nautilus should follow
the same aproach that I mentioned earlier: Show the thumbnails _only_
for the files that are currently visible on the window.  In this case
there is no thumbnailing generation and the proccess should be a lot
faster.  When the user starts scrolling the data will be fetched from
the cache as needed.

That would be the whole idea and I think this is something doable for
Gnome 2.10.

If you want a "preview" of this then take a look at gThumb (actually I
was inspired by this).  If you browse the same folder with nautilus and
gThumb you will see a huge difference.

I'll hope the maintainers take a look on this.  So far they have been
doing a great job... keep up the hard work guys.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]