Re: Some performance notes
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: Tim Janik <timj gtk org>
- Cc: Owen Taylor <otaylor redhat com>, Johannes Stezenbach <js convergence de>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Some performance notes
- Date: Thu, 30 Aug 2001 16:02:16 +0200
Hi,
> > > > in gobject.c is always a function call, but if you trace
> > > > down the G_LOCK() macro used elsewhere, you'll see it doesn't
> > > > make a function call unless threading is enabled.
> > >
> > > do you have any indication of g_static_rw_lock_reader_lock()
> > > actually consuming significant time for the non-threaded case?
> >
> > Yes, in my profiling (debug off) it was eating about 4% of the
> > CPU time.
>
> wow, that requires further investigation, as i vaguely remember a
> profile of sebastian that indicated locks being pretty fast for
> the non-threaded case.
It should be, it just involves calling
if (!g_threads_got_initialized)
return;
But of course the penalty of first doing the function call still applies.
So we might make them macros and call them only, when the thread system is
really initialize, as with the other virtual thread related functions:
Like this:
#define g_static_rw_lock_writer_lock(lock) (g_thread_supported () ? \
g_static_rw_lock_writer_lock_internal (lock) : (void)0)
void g_static_rw_lock_writer_lock_internal (GStaticRWLock* lock)
What do you think?
Bye,
Sebastian
--
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]