KDirWatch and kdevelop idle CPU usage (4.7/1.7)

Milian Wolff mail at milianw.de
Mon Apr 20 17:14:42 BST 2015


On Monday 20 April 2015 12:32:14 René J.V. Bertin wrote:
> On Thursday April 16 2015 15:14:28 Milian Wolff wrote:
> > On Thursday April 16 2015 14:09:41 Milian Wolff wrote:
> > >Please attach a profiler and figure out where the CPU time is spent. This
> > 
> > does
> > 
> > >not sound good at all. But without help from your side that tells us
> > >where
> > 
> > the
> > 
> > >CPU cycles are spent there is nothing we can do.
> 
> Below is a backtrace that should give some hints as to what those CPU cycles
> are spent on. It's from the main thread, the only one (of 14 total) that's
> taking between roughly 20% and 35% CPU. The session has 4 projects imported
> through kdev-qmake (thanks for pointing me to that one): two created from
> qtbase src.pro (the git 5.4.2 head and the other from the recent 5.4.2
> snapshot); a small qmake test project and a project containing the MacPorts
> tcl and patchfiles that make up the qt5 port.
> 
> I think it's rather evident that we're looking at CPU usage from watching
> the project directories. If there are OS differences in the way this is
> implemented (which doesn't seem unlikely at all, and btw, yes, we're
> talking about OS X here) that would explain why there's no such idle
> activity on Linux (if that's indeed the case).
> 
> I haven't yet had the time to look at KDirWatch nor at how it is deployed in
> KDevelop (or KDevPlatform). Is it possible to decrease the resources used
> for instance by decreasing a poll frequency? What do I lose if I switch off
> the feature altogether?

On Linux it won't use polling. Not sure whether it should do it on Mac, afaik 
it should fall-back to QFileSystemWatcher (could you check? see kdirwatch.cpp 
in kcoreaddons/src/lib/io and/or check KDirWatch::internalMethod).

Because its not an issue on Linux, you cannot configure the poll via the GUI. 
But the code has support to configure the poll interval via env vars 
apparently, try KDIRWATCH_POLLINTERVAL and KDIRWATCH_NFSPOLLINTERVAL.

Generally, you'll lose potentially a lot. E.g. changes to the file system 
won't show up in the project manager view. This can be highly annoying and 
you'd have to reload manually.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de



More information about the KDevelop mailing list