[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Reducing the number of conflicts in libraries
From:       Harri Porten <porten () trolltech ! com>
Date:       2001-09-27 17:16:43
[Download RAW message or body]

On Thu, 27 Sep 2001, Guillaume Laurent wrote:

> As far as I know, Lubos is right. I'm looking at qvaluelist.h and I'm pretty 
> sure you'd get a very significant benefit by moving the implementations out 
> of the body.

I do believe in this, too. In theory. I'd prefer to see some numbers.

I just recompiled Qt and Designer with -O3 (gcc 3.0.1) and got at a saving
of 5 kB in the application opposing a plus of ~1K in the library (insert() 
and insertSingle() methods changed). I might have to convert and compile
more code to get clearer results.

> > I was told that gcc < 3.0 doesn't do any automatic inlining of template
> > member functions at all so one has to be very carefull with a redesign.
> 
> As some point with Gtk-- we tried to inline most of our code, since it was 
> essentially single-line methods. The library size almost doubled. That was 
> with g++ 2.9 I think.

I should take a closer look at the suggest pragmas directives.
> 
> Another thing is, inlining in templates can easily become a performance 
> killer because due to the expansion of templates within templates etc... you 
> can get fully expanded methods which won't fit in your CPU cache anymore.

Yes. But there are so many factors playing a role that is almost 
impossible to judge from a plain look.

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic