Patch: wake up duchainlock writers

Milian Wolff mail at
Tue Dec 15 11:32:28 UTC 2009

On Tuesday, 15. December 2009 00:42:35 Milian Wolff wrote:
> On Tuesday 15 December 2009 00:24:29 David Nolden wrote:
> > I've re-implemented the duchain locking now using a spin-lock behavior,
> >  which makes the locking much faster at least in the single-threaded
> > case.
> >
> > The sleeping interval (for writers and readers alike) now is 500
> >  nanoseconds, maybe that is enough to warrant a good multi-threaded
> >  behavior?
> I'm doing callgrind profiles over the night for single threads. Tomorrow I
>  can also do with up to 9 threads (i7). Of course, PHP and duchainify
>  (since remote machine). Please tell me what I should use for --threads N.

OK, did the single thread profiles:

- when parsing just the internal PHP Function file, the overall cost is down 
from 19 E9 to 9 E9, i.e. about 50%. Parsing (real-part of time output) is 
roughly 15% faster on this one machine.

- the above is probably due to QMutex::lock/::unlock being called only 18.3 
mio times, instead of 38.5 mio times.

- shouldDoDUChainReference is not on top of the list of incl-cost anymore, but 
on place 10 (excluding <cycle 10>)

- even when comparing self-costs', the cost of shouldDoDUChainReference is 
slightly lower than before, while nearly all others got a lot lower (esp. 
getContextForIndex, but this was also optimized by you, no? Damn, I think I 
didn't do a profile after that patch!)

Milian Wolff
mail at

More information about the KDevelop-devel mailing list