D pointers

George Staikos staikos at kde.org
Sat Oct 1 19:18:04 BST 2005

On Saturday 01 October 2005 13:57, Thomas Braxton wrote:
> > > >   I'm glad someone else pointed this out.  I was trying to get out of
> > > > this conversation altogether (and I will just revert changes to my
> > > > own classes that I don't like), but this is a very valid point.
> > >
> > >  No, it's not a very valid point. Unless somebody can find a problem
> > > with my KURL benchmark (which I ran on i386), the point is as valid as
> > > about 2% performance loss. And BTW exactly which of your classes are
> > > performance critical?
> >
> >    It's not a valid point that register pressure is an issue on our most
> > significant platform?
> This is a small test i made up to see the difference of d-pointers on
> register pressure. The test has two classes with exactly the same members,
> one using a d-pointer the other not.
> Compile with g++ -O3 -g3 -fPIC -c test.cpp
> the other file is the output of objdump -CSd test.o
> If you look at status() in both classes you see that this{0x8(%ebp)} is
> assigned to %eax.
> In withDPointer::status() this->d{(%eax)} is then assigned to %eax.
> Then both assign _status{0x8(%eax)} to %eax.
> register pressure doesn't look to be an issue on i386, at least w/ gcc
> 4.0.1.

  Good to know.  Also good, I should point out, that I didn't jump to any 
conclusion that d-> adds to it.  I just claimed that register pressure 
('period') is an issue on x86.

George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

More information about the kde-core-devel mailing list