Re: invalid arguments to public API: g_assert, g_return_if_fail or continue with undefined behavior



On Tue, 2005-09-13 at 09:51 -0400, Christopher James Lahey wrote:
> On Tue, 2005-09-13 at 12:48 +0200, Christian Neumair wrote:
> > I'd really like to have a GNOME-wide policy for dealing with public API
> > and invalid arguments. If we feel like the traditional C route is good,
> > we can remove all of these codeblocks for the sake of performance. I
> > think some of the asserts/return_if_fail statements were left out for
> > exactly that reason. I suppose this has a measurable performance impact
> > for little helpers that are often called.
> 
> Has anyone done profiling on this?  There's no reason to turn these off
> if they don't actually take up a noticeable percentage of time, memory
> or disk space.
> 
> Perhaps we should do some profiling with and without these calls to see
> if there's a difference?

I'd expect in a UI application they won't make much difference, but I do
know that for the DBus port of EDS turning off asserts in DBus made a
20% improvement in the speed benchmarks...

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





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