I decided to do some profiling on Thunar startup to find out why it takes 2-3 seconds to popup here using the Gtk+ 2.8 port (while it starts up faster with the full debug build of Gtk+ 2.9). Using Federicos simple access() trick, I found out that the majority of time was spent in gtk_window_size_request()
and gtk_window_realize()
.
Looking at the relevant parts of the truss output it was very easy to locate the cause of the problem. gtk_window_realize()
loaded the GtkIconTheme
instance for the default screen, which in turn tried to stat()
every icon in Tango and all inherited icon themes. Looking at the Gtk+ source, it shouldn’t stat()
the icon files if an updated icon-theme.cache
file is found. Since I had updated icon-theme.cache
files for all relevant icon theme directories (the truss output also shows that after stat()
ing all icon files, the icon-theme.cache
file is finally used), it should not stat()
the icons, but only the icon directory (according to the Gtk+ source).
So after some further research, I found this patch, which gets applied to the x11-toolkits/gtk20
FreeBSD port. The patch basicly changes the icon cache loading to first stat()
all icon files in the theme and test if any of them is newer than the cache file. That does of course make the startup slow (the startup of every Gtk+ application on FreeBSD). Whoever came up with that idea was definitely on crack.
Ok, so removed that patch, rebuilt the port, and voila…
1/2 second from startup to gtk_main()
, that’s quite ok. Now whats left over is the question why gtk_window_size_request()
takes that long on first call. Looking at the truss log again, it seems to be the Pango initialization. Have to check this later…
Update
For the sake of completeness, here’s the time it takes to completely open and display (measured as wait for the last expose event) a folder (the thunar source directory, 223 files and folders) in Thunar:
1.3 seconds isn’t that bad for a first unoptimized release. Still room for improvement, tho.
Thunar will enter beta phase soon, so I thought I’d share two additional screenshots of what’s to come soon.
First, Thunar finally supports DnD to shortcuts (after crashing Thunar and Nautilus several times while testing, but finally remembered to remove GTK_DEST_DEFAULT_ALL
). Screenshot
Next, I started work on the tree view. The basic tree view and tree model took less than a day, pretty easy using GNode
. But I guess it’ll take another week to add all the small details. Screenshot
I just released Thunar-0.2.2alpha2 and libexo-0.3.1.4alpha2. As suggested by the name, it is an alpha release and it is thereby considered to be more or less stable in what it does, but it is by no means a final version.
You’ll need atleast libxfce4util 4.2.2, Gtk+ 2.6.4, shared-mime-info 0.15 and desktop-file-utils 0.10 to build and run Thunar. In addition, Gamin or FAM are highly suggested to enable file system monitoring in Thunar. For HAL support on Linux, the libhal-storage devel package is required (0.5.0 or above). The README
file contains a complete list of dependencies and optional packages.
The official announcement is available at: http://thunar.xfce.org/news.html#2006-03-05
Additional (updated) screenshots are available at: http://thunar.xfce.org/screenshots.html
The source tarballs can be downloaded from: http://thunar.xfce.org/download.html#0.2.2
Please report bugs to the Xfce Bug Tracker (product Thunar) at: http://bugzilla.xfce.org/
I finally came around to fix some long standing issues with the internals of the file launching stuff in Thunar (to sum it up: it was a mess). Now it’s cleaned up, and with the new classes it was actually too easy to add support for desktop actions (see the desktop file spec for details) to Thunar (Brian already added support to Xfmedia some time ago).
In addition the Open With actions are now also available if more than one file is selected.
I just released Thunar-0.2.0alpha and libexo-0.3.1.2alpha. As the name suggests, it’s an alpha release and it is thereby considered to be more or less stable in what it does, but it’s by no means a final version.
You’ll need atleast libxfce4util 4.2, Gtk+ 2.6, shared-mime-info 0.15 and desktop-file-utils 0.10 to build and run Thunar.
The official announcement is available from:
http://thunar.xfce.org/news.xhtml
The source tarballs are available from:
http://thunar.xfce.org/download.xhtml
Please report bugs to the Xfce Bug Tracker (product Thunar) at:
http://bugzilla.xfce.org/