After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 505811 - slow image switching due to GtkRecent
slow image switching due to GtkRecent
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-26 22:45 UTC by Claudio Saavedra
Modified: 2008-01-06 00:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sysprof output for image loading times (14.74 KB, image/png)
2007-12-26 22:47 UTC, Claudio Saavedra
  Details
sysprof output during EogWindow's construction (23.03 KB, image/png)
2007-12-26 22:48 UTC, Claudio Saavedra
  Details
use g_idle_add to add the loaded image to the recent files (1.54 KB, patch)
2007-12-26 22:50 UTC, Claudio Saavedra
committed Details | Review

Description Claudio Saavedra 2007-12-26 22:45:59 UTC
Doing some research on why eog takes so long on image switching, I discovered that most of the lapse after the image is loaded and before is shown is consumed by calls to GtkRecent code.

Not sure if this operation should be slow at all, but my naive approach on making EOG more responsive is not to add the image to the recent manager immediately, but by means of a g_idle_add call. The results, in my Celeron 1.4 GHz, are really cool.

Further investigation showed that there is also some considerable time wasted during the initialization of eog. Not quite sure if using the same technique makes any difference, as I can't really notice it.

I attach some sysprof graphs and a proposed patch that makes eog more smooth during image switching and (perhaps?) during the initial launch.
Comment 1 Claudio Saavedra 2007-12-26 22:47:32 UTC
Created attachment 101649 [details]
sysprof output for image loading times
Comment 2 Claudio Saavedra 2007-12-26 22:48:32 UTC
Created attachment 101650 [details]
sysprof output during EogWindow's construction
Comment 3 Claudio Saavedra 2007-12-26 22:50:12 UTC
Created attachment 101651 [details] [review]
use g_idle_add to add the loaded image to the recent files
Comment 4 Claudio Saavedra 2007-12-26 22:55:01 UTC
Of course, there's always the posibility that we are doing something wrong with the GtkRecent code, or that there's room for optimization inside of it.
Comment 5 Felix Riemann 2008-01-01 18:55:07 UTC
One "problem" GtkRecent currently has is that the bookmark file is not (automatically) cleaned up. So, after some time this file is quite big and needs longer and longer to parse (which is done on initialisation and I think on changes as well).
Comment 6 Claudio Saavedra 2008-01-02 13:40:05 UTC
Anything we can do on the application side to clean it up?

Felix, are you OK with the patch?
Comment 7 Claudio Saavedra 2008-01-06 00:18:29 UTC
I committed this patch with a minor modification: using G_PRIORITY_LOW, so high quality image rendering has more priority than this, and therefore images are rendered in HQ without an extra lag.

(Trunk, rev 4293).

2008-01-05  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

	* src/eog-window.c: (add_uri_to_recent_files),
	(eog_window_display_image): Add the URI to recent files in a low
	priority idle function, making images display faster.
	Fixes bug #505811.