[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-optimize
Subject: Re: Value-based classes: struct vs shared-data
From: David Faure <faure () kde ! org>
Date: 2006-09-29 22:39:27
Message-ID: 200609300039.27689.faure () kde ! org
[Download RAW message or body]
On Friday 29 September 2006 22:54, Roger Larsson wrote:
> On Friday 29 September 2006 14:31, David Faure wrote:
>
> > Any mistakes in my test? ;)
> >
>
> You did not tell what compiler (version) and options you used.
> But I guess it was unoptimized...
gcc-4.0.3, default kde-trunk buildsystem options with debugfull enabled.
Let's see what happens with -O2 instead of -g3 -fno-inline...
QDEBUG : KFileItemTest::testPerformance() CTOR: Simple struct: 16
QDEBUG : KFileItemTest::testPerformance() CTOR: With QSharedDataPointer: 18
QDEBUG : KFileItemTest::testPerformance() COPY CTOR: Simple struct: 5
QDEBUG : KFileItemTest::testPerformance() COPY CTOR: With QSharedDataPointer: 1
Hey that's pretty good. The performance hit for the default ctor is down to 12%
while the performance hit for the copy ctor when not using qshareddatapointer
is still very high (around 500%, although with '1' the number is too small to mean anything).
This seems to confirm that I should go ahead with QSharedDataPointer.
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
Kde-optimize mailing list
Kde-optimize@kde.org
https://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic