KSyCoca, Thread safety, and Cache invalidation
David Faure
faure at kde.org
Tue Jul 28 15:28:45 BST 2015
On Tuesday 14 July 2015 19:28:58 Thomas Lübking wrote:
> On Dienstag, 14. Juli 2015 19:00:14 CEST, Milian Wolff wrote:
> > On Tuesday, July 14, 2015 11:49:25 AM David Faure wrote:
> >> On Friday 26 June 2015 18:03:00 Frank Reininghaus wrote: ...
> >
> > It has. Querying the current time repeatedly is quite costly,
> > and often shows
> > up in code that extensively uses timers, or
> > QDateTime::currentDateTime() etc.
> >
> > But it's probably still cheaper than querying on-disk meta data
> > in the worst
> > case, esp. on old rotary disks.
>
> Actually, checking currentTime() is already the problem here (causing the IO for the timezone stuff), see http://marc.info/?l=kde-core-devel&m=143533622526705&w=1 (the 1st paragraph part of my comment somehow turned into a second-level quote)
>
> Comparing a monotic timer (QElapsedTime) is however - at least on linux - close to cost free PLUS: one can have an entirely free "do not check again during this event cycle" flag.
I used QElapsedTimer in https://codereview.qt-project.org/122247
and the resulting performance improvements are amazing.
kbuildsycoca5 is twice faster.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the kde-core-devel
mailing list