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 124524 - Nautilus too slow (20 secs) to startup on solaris(PATCH)
Nautilus too slow (20 secs) to startup on solaris(PATCH)
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.6.x
Other Solaris
: High major
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-10-14 05:29 UTC by devsk
Modified: 2005-08-15 01:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
relevant truss output (28.92 KB, text/plain)
2003-10-16 05:22 UTC, devsk
  Details
Update nautilus-scripts directory based menu using g_timeout (3.00 KB, patch)
2003-10-16 10:10 UTC, devsk
none Details | Review
A stable working patch. (5.71 KB, patch)
2003-10-17 04:10 UTC, devsk
none Details | Review
why copy list? (5.58 KB, patch)
2003-10-17 15:27 UTC, devsk
none Details | Review
truss on nautilus when it hangs for 3 seconds or more (58.21 KB, text/plain)
2004-07-06 19:34 UTC, devsk
  Details

Description devsk 2003-10-14 05:29:54 UTC
I built gnome 2.4 on solaris 2.6 and I find nautilus very slow on solaris,
whereas the same build parameters on linux don't make it so slow. It takes
around 20 secs to startup on solaris while it takes around 2 secs on my
linux machine.

I did a truss on the nautilus and found that it was "stat"ing my /net and
/vobs shares all the while(every 2 seconds, which I consider too little a
timeout). On our company intranet, automount mounts tonnes of networked
systems in /net and /vobs, and 'stat'ing those doesn't make any sense
during startup. It should be done on demand or later on in the bg.

Why does it stat and load all the configuration files, .xml, .png, .svg,
mime-info, /usr/share directories etc. when I open a new window. When no
window is open, the process is still there in the memory(eating 37MB), why
does it stat and load the conf again? It stats, opens and reads every
single file in my home dir(including all .* files), is it trying to get
their sizes this way? Why? I want to understand this. Somebody please explain.

Then there are miles long of time() calls. Is that a wierd way of passing a
specified amount of time?

Another thing I notice is that existing windows also blank out till the new
window comes up when I open a new window. This happens for all the new
opened windows.

I am not sure what else does it do during startup that makes it so slow.
But I have a request for nautilus developers: please look into making this
thing fast for 2.6 instead of going for new features.
Comment 1 devsk 2003-10-14 16:35:15 UTC
On linux, it doesn't open and read all files in my home dir. Why on
solaris?
Comment 2 Kjartan Maraas 2003-10-14 23:02:51 UTC
Could it be related to famd being suboptimally implemented on solaris?
not being there at all? difference in hardware performance? It's hard
to say without more details.
Comment 3 devsk 2003-10-15 02:37:02 UTC
could be because of absence of famd!

But why should it try to read all files in home dir during startup?
stat, open, read and then lseek on all files in home dir! which
function is doing that, any idea? I can confirm this because the other
user's home on the system is slightly less cluttered than me and he
loads nautilus faster but only  few seconds.

Then there is this call to time(). For 3-4 seconds, in the truss
output I don't see anything but time(). I can see the return value
getting incremented after few tens of calls. And this is the time when
nautilus window is totally un-responsive(100% cpu usage). Only thing I
could find was gnome-vfs(get_value_real) doing time() to see if its
time to reload mime-data. It does check for 5 seconds elapse time.
This is like "are we there yet". why not have a glib timeout based
callback for this as well? Would you know of any other function doing
time() in a loop like that unintentionally?
Comment 4 devsk 2003-10-15 02:41:58 UTC
it feels like hang because during those 3-4 seconds of looping time()
calls, it doesn't do poll() for input events, otherwise I would see
those system calls.
Comment 5 devsk 2003-10-16 05:22:22 UTC
Created attachment 20731 [details]
relevant truss output
Comment 6 devsk 2003-10-16 05:28:15 UTC
first and last four lines: processing input events.

in between (10 secs have passed and its frozen during that time),
don't know what its trying to do but its reading heck a load of icons
and seems to be searching in hard coded places like
/usr/share/pixmaps. On solaris, I have installed gnome under my home.

simple theme with gnome default icons, same result.
Comment 7 devsk 2003-10-16 10:10:02 UTC
Created attachment 20741 [details] [review]
Update nautilus-scripts directory based menu using g_timeout
Comment 8 devsk 2003-10-16 10:38:29 UTC
hahaha...some guys like to abuse nautilus-scripts. I am one of them.

I have like 10 dirs in there, each one has 3 dirs and each of those
has like 8 files each. When nautilus goes to update menus, it tries to
load all of these(around 250 files) at once, getting mime-info, doing
icon-lookups(continuous time() calls from these two) etc. Someone (I
mean developer) decided they will do breadth first search of the FS
tree and every time they will go one level deep, building list of dirs
to process in one shot at the deepest level. Well, it takes 10 secs to
accomplish that last step in one whole for my 30 dirs. During that
time nautilus GUI doesn't respond.

When I open a nautilus window, it is usually to search for a file and
open it with one of the default programs. So, I need quick response.
Menus can update slowly, over a period of 30 secs or even a minute. I
don't care. So, I added this quick fix hack to schedule each of the
dirs to update one after the other every one second using
g_timeout_add. So, GUI stays free and available.

The patch is a great relief on CPU usage and GUI responsiveness!!
definitely try, but on your own risk...;) please let me know of any
bug you see in there, since I am new to the g-coding.

If you are leaving nautilus-scripts to the users and file system
limits, your update algorithm should be smarter than what it is now.
Gurus, please take over!

PS: BTW, linux nautilus cried too, when I copied the same scripts over
to my linux box.
Comment 9 mwehner 2003-10-16 11:44:52 UTC
Re-opening, setting priority->high and adding PATCH keyword.
Comment 10 devsk 2003-10-16 20:08:40 UTC
there is a obvious bug here. if you close the window before the timers
expire, the g timers are not cleared and hence can lead to segv. I
will have a more sober patch ready soon.
Comment 11 devsk 2003-10-17 04:10:36 UTC
Created attachment 20755 [details] [review]
A stable working patch.
Comment 12 devsk 2003-10-17 04:13:04 UTC
I finally got the time to write it. Have a look and let me know.
Comment 13 devsk 2003-10-17 15:27:59 UTC
Created attachment 20763 [details] [review]
why copy list?
Comment 14 alexander.winston 2004-01-02 22:04:52 UTC
Upgrading priority to High due to the attached patches.
Comment 15 Dave Bordoley [Not Reading Bug Mail] 2004-01-25 01:28:51 UTC
you should send your patch nautilus-list@gnome.org so that it gets
some developer attention.
Comment 16 alexander.winston 2004-01-28 01:21:12 UTC
Adding the portability keyword.
Comment 17 Luis Villa 2004-02-19 14:15:05 UTC
Also adding the perf keyword, and cc'ing wipro in case they are
interested.
Comment 18 devsk 2004-07-06 19:34:04 UTC
Created attachment 29292 [details]
truss on nautilus when it hangs for 3 seconds or more

This truss output shows that nautilus is not doing anything but polling for X
events on socket 4, time() return value keeps increasing and the CPU usage is
100% for nautilus during these 3 seconds. Will someone who knows enough about
nautilus be kind enough to explain why it happens? This happens when I click on
the "File" menu item on a nautilus window.
Comment 19 Christian Neumair 2005-05-23 16:48:55 UTC
Do you still see these performance problems?
Comment 20 Christian Neumair 2005-07-10 17:07:01 UTC
Sunil, any news?
Comment 21 devsk 2005-07-10 18:25:26 UTC
please close this bug. I have no interest in nautilus anymore.
Comment 22 Christian Neumair 2005-07-10 18:54:45 UTC
OK. Thank you anyway. Let's hope the new features in Nautilus 2.12 will convince
you to spend some time on it again.