Re: gnome-vfs performance patch



On Mon, 21 Oct 2002, Brian Cameron wrote:

> 
> [ Sorry here's the same email with the patch in unified diff format ]
> 
> gnome-vfs gurus:
> 
> I did analysis of nautilus startup time with the Forte Performance
> Analysis Tools and found the following:
> 
> nautilus: 3.210 seconds total user time, 30.850 seconds total system time
> 
>    5.620 system seconds spent in this stacktrace:
>    
>       gnome_vfs_module_callback_use_stack_info
>          g_hash_table_foreach
>             static function
>                g_strdup
>                   g_malloc
> 
> I have worked with Michael Meeks to generate the attached "vfs-speedup.pat"
> patch.  This patch removes the need for copying default callback functions
> in gnome_vfs_module_callback_get_stack_info.  This function is in the file
> gnome-vfs/libgnomevfs/gnoem-vfs-module-callback.c.
> 
> Note that the function gnome_vfs_module_callback_invoke in the same file
> is the only one that accesses the callback hashes.  It already will pull
> the callback from the default if it doesn't find it in the private thread
> memory (aka callback_stacks_key or async_callback_stacks_key).
> 
> On gnome-hackers Michael Meeks pointed out that "We should not copy the
> default authentication callbacks; if someone is relying on the timing of
> exactly when they set the default callback for a certain op [ NB. it can't
> be un-set etc. ], then they're smoking crack and deserve oddness."

I had a quick look at this. Aren't we switching one performance problem 
for another? The fallback to default_callbacks/default_async_callbacks 
needs to take the callback_table_lock, which serialize an otherwise 
lock-less codepath. I'm not sure how much this code is called and how much 
the default callbacks are used, but someone obviously spent lots of time 
making it lock-less.

What i find strange is that the hash-table copying could take that much 
time. Unless i'm missreading this the two hash tables should (in the 
nautilus case) have had two entries each. I find it hard to believe that 
copying four strings took 5.6 seconds. Aren't we looking at the wrong 
thing here?

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a genetically engineered Republican sorceror with nothing left to lose. 
She's a blind hip-hop angel with a birthmark shaped like Liberty's torch. They 
fight crime! 




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