[PATCH] New KFileItem::assign() for Optimizing KDirListerCache
Michael Brade
brade at kde.org
Sun Mar 27 12:33:44 BST 2005
On Friday 25 March 2005 16:07, Michael Brade wrote:
> On Friday 25 March 2005 15:57, David Faure wrote:
> > Hmm, basically all you gain is a call to assign, which isn't much, but
> > OK. (the ctor call does the same job as setUDSEntry anyway)
> >
> > Similary we don't have KURL::setURL(), one has to use u = KURL( newString
> > [,options] ) which also needs a ctor call and an assignment, but maybe
> > you're right that we should have that, if used in loops.
>
> I guess... currently I'm trying to time the gain of not using the
> new/delete with 30000 items but I've got a memory problem ;-}
Ok, 8560 items, but a little surprise: no gain when switching from new/delete
to *item = KFileItem(). But there is some improvement with the setUDSEntry()
method:
- with original code or CTOR call: 3.5 - 3.6sec
- with setUDSEntry: 3.2 - 3.3sec
That's about 0.2 - 0.3 seconds faster without the CTOR call. Not all that
great but at least about 8%. OTOH, regarding the huge amount of work done
altogether, that's quite an improvement.
Cheers,
--
Michael Brade; KDE Developer, Student of Computer Science
|-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
°--web: http://www.kde.org/people/michaelb.html
KDE 3: The Next Generation in Desktop Experience
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050327/aa53291b/attachment.sig>
More information about the kde-core-devel
mailing list