Regression: Caching of compiler defines/include

Milian Wolff mail at milianw.de
Wed Jul 29 22:24:30 UTC 2015


On Wednesday, July 29, 2015 10:03:25 PM Sergey Kalinichev wrote:
> Hi,
> 
> I can't reproduce it. I created a custom compiler, set custom
> arguments for it and tried to parse a project, I get only one cache
> miss, all subsequent calls to includes/defines use values from the
> cache.

You need to add a custom path for any project. Essentially, just make sure you 
hit the long path of configForItem in compilerprovider.cpp

It will call:

SettingsManager::globalInstance()->readPaths
doReadSettings
createCompilerFromConfig
createCompiler
...
GccLikeCompiler::GccLikeCompiler

eventually then, the ::includes/::defines methods on this new compiler are 
getting called, which will not be cached (it's a new project!) and then it's 
really bad performance wise.

> >and recreates Compiler instances all the time
> 
> That's odd. Please check your config file (.kdev4 file), maybe it
> contains compiler name that doesn't not exist? Note that if you added
> a compiler here manually, you also must add it to the session config
> file,

I did not add it manually, and this case may happen when something changes 
internally - and probably that's what is occurring. It must be handled 
gracefully! 

> Also, please, check whether adding this line:
> "SettingsManager::globalInstance()->provider()->registerCompiler(compiler);"
> at settingsmanager:79 fixes the issue for you.

I'll now, and get back to you in a minute.

Many thanks for investigating, cheers!

> On 7/29/15, Milian Wolff <mail at milianw.de> wrote:
> > On Wednesday, July 29, 2015 03:56:29 PM Milian Wolff wrote:
> >> Hey Sergey,
> >> 
> >> your recent patch broke the caching of the GCCLikeCompiler includes and
> >> defines, leading to excessive calls execve and string parsing etc. pp.
> >> CompilerProvider uses configForItem which re-reads the settings and
> >> recreates Compiler instances all the time, which is a huge waste of
> >> resources.
> >> 
> >> Did you not notice this extreme performance regression?
> >> 
> >> Could you have a look at that now? I'm in the middle of something else
> >> (KTextEditor plugin integration) and will revert your patch locally for
> >> now.
> >> Later today I'll then hopefully have time to fixup this issue, but I'd
> >> appreciate if you could work on that ASAP. Please do test your changes
> >> more
> >> thoroughly - this should have been very obvious when you try to parse any
> >> project.
> > 
> > Oh, this only happens when a custom compiler is configured... I'll try to
> > figure out a way to cache it somehow.
> > 
> > Bye
> > --
> > Milian Wolff
> > mail at milianw.de
> > http://milianw.de

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150730/ca2657aa/attachment.sig>


More information about the KDevelop-devel mailing list