[PATCH] New KFileItem::assign() for Optimizing KDirListerCache
Michael Brade
brade at kde.org
Fri Mar 25 15:07:34 GMT 2005
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 ;-}
> OTOH I just noticed that the patch removes this from refresh() - why?
> - m_access = QString::null;
> - m_size = (KIO::filesize_t) -1;
> m_metaInfo = KFileMetaInfo();
> - for ( int i = 0; i < NumFlags; i++ )
> - m_time[i] = (time_t) -1;
Because this is done in the init() method, which is called a bit further down.
> IIRC this is needed when the permissions, size, or access times of a file
> have changed.
Yes.
--
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/20050325/727ecff3/attachment.sig>
More information about the kde-core-devel
mailing list