Patch: wake up duchainlock writers
David Nolden
zwabel at googlemail.com
Tue Dec 15 12:11:54 UTC 2009
Am Dienstag 15 Dezember 2009 12:32:28 schrieb Milian Wolff:
> 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!)
>
Actually I've only changed the duchain-locks, aka. the internal behavior of
DUChainReadLocker and DUChainWriteLocker. I haven't done anything about
shouldDoDUChainReferenceCounting or contextForIndex yet.
Greetings, David
More information about the KDevelop-devel
mailing list