LWN.net Logo

gtk file selector dialog

gtk file selector dialog

Posted Jul 25, 2006 1:49 UTC (Tue) by joey (subscriber, #328)
Parent article: OLS: On how user space sucks

My favorite example at the moment is the gtk file selector dialog, as seen in firefox. Each time you change directories, it first uses getdents to get all the files in the directory, then stats each individual file, then _reads_ 4k of each file to determine the file type. That information is used to put undecipherable tiny useless icons next to the files indicating their file type.

If you're unfortunate enough to navigate to /usr/bin using it, it will probably lock up for a good 2 minutes as it reads 10+ mb of data and makes tens of thousands of system calls. Compare with ls /usr/bin which takes about 0.2 seconds even in inefficient sort and colorise mode.


(Log in to post comments)

gtk file selector dialog

Posted Jul 27, 2006 11:13 UTC (Thu) by jbh (subscriber, #494) [Link]

Yes! 2 minutes to choose an application sounds about right (even if I know the exact path and write it in the Ctrl-L location dialog).

I guess it wouldn't be too hard to work around either, but I really don't want to wade into the flame fest that surrounds the gtk file chooser. So... for now I mostly use opera, at least on slow machines.

gtk file selector dialog

Posted Jul 28, 2006 15:03 UTC (Fri) by bjornen (guest, #38874) [Link]

> So... for now I mostly use opera, at least on slow machines.

Ouch! opera 9.0-20060616.6 is one of the worst offenders on my computer (a
750MHz P4 laptop (dell i8k)).

top's TIME+ column says it used 24 CPU seconds by the time it's done
loading. After this it continues to steal ~3% CPU by itself and increasing
Xfree86's CPU usage to ~7%.

And this on a fresh install, only 9 tabs opened, the window minimised and
javascript, plugins, et al turned off.

There some surprising blame and constructive criticism in Federico Mena
Quintero's blog -
http://primates.ximian.com/~federico/news-2005-11.html#mo...

gtk file selector dialog

Posted Jul 27, 2006 14:21 UTC (Thu) by emj (guest, #14307) [Link]

The best part is you can't just enter a command to execute having firefox look it up in the path.. So this bug of GTK fileselector only show up because a misfeature in Firefox.. ;-(

gtk file selector dialog

Posted Jul 27, 2006 14:33 UTC (Thu) by emj (guest, #14307) [Link]

Here is te bug report in bugzilla all you have to do is fix it. Does any one know if gnome/kde has a "open with application" dialog like the one windows uses

gtk file selector dialog

Posted Aug 6, 2006 16:07 UTC (Sun) by Duncan (guest, #6647) [Link]

> Does [...] gnome/kde has a "open with application"
> dialog like the one windows uses

KDE (3.5.4) does. It pops up a 3-section window, textbox file chooser on
top (browse button to the right), a tree-view copy of the K-Menu in the
center, and two checkbox options on the bottom, run in terminal (with a
don't close after exit suboption that's dimmed out until run in terminal
is selected), and remember application association (similar to the
MSWormOS dialog option). Below that are the usual OK/Cancel buttons.

Duncan

gtk file selector dialog

Posted Aug 3, 2006 9:17 UTC (Thu) by kelvin (guest, #6694) [Link]

If you're unfortunate enough to navigate to /usr/bin using it, it will probably lock up for a good 2 minutes as it reads 10+ mb of data and makes tens of thousands of system calls.

This was all too true on older versions of GTK+, but the file selector (among other GTK-things) has been heavily profiled and improved in the latest versions. On this P4/3GHz Ubuntu install with GTK+ 2.8.20, a cold-cache opening of /usr/bin takes roughly 2 seconds (including display of the "undecipherable icons").

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds