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

List:       kde-commits
Subject:    Re: kdebase/kcontrol/kdm
From:       Lubos Lunak <l.lunak () sh ! cvut ! cz>
Date:       2002-01-15 15:29:17
[Download RAW message or body]

On Mon 14. January 2002 03:11, Rik Hemsley wrote:
> #if Oswald Buddenhagen
>
> > > (I will never understand why people use QFont pointers)
> >
> > because it's more effective? c++ makes many things simple. especially
> > unnecessarily slow/bloated code (not that it would matter much in this
> > case, but in general i'm sure we could make kde twice as fast by
> > eliminating typical unefficiencies hidden by high-level constructs).
> > even if qfont is a qshared, there is still a significant overhead in
> > copying it compared to assigning a pointer.
>
> Did you measure that ? What was the outcome ? It's bad programming style
> to use pointers to QFont when they're not necessary, so you need a good
> reason for it.

 I don't think it's a bad programming style to use pointers when you know 
what you're doing. There was nothing wrong with the code using QFont pointer 
(well, except for the warning), even though the only overhead in the case of 
using QFont directly is QShared::(de)ref .
 In fact, we're spending at least 20% time just (de)allocating QShared 
inherited classes and calling QShared::(de)ref . And I think we could make 
KDE more than twice as fast by eliminating efficiencies hidden by high-level 
constructs (why the hell does drawing 500 lineedits need 1 second on TB850?). 
Not that I'm suggesting to rewrite KDE in assembler ... it's the price we 
pay, and I guess we can't do that much about it. But why should be writing 
efficient things called bad programming style, when one wants to write it 
that way?

-- 
 Lubos Lunak
 llunak@suse.cz ; l.lunak@kde.org
 http://dforce.sh.cvut.cz/~seli
[prev in list] [next in list] [prev in thread] [next in thread] 

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