Hi guys,
I'm trying to reduce the enormous number of lock done by the current
implementation of Embedded Component Manager and I could use some more
brains to check what I did.
You can find the new version on
https://github.com/xwiki/xwiki-commons/blob/feature-improvecm/xwiki-commons…
Quick comparison with the current one:
* removed all "synchronized (this)" that was in pretty much all the
methods and which made the CM block everything whenever anyone was
using it
* used ConcurrentHashMap to securize the insertion/search of components
* basically the only remaining explicit lock is on singleton component
initialization mostly to make sure we don't initialize the same
component at the same time
If you find some small modification to improve a bit the speed don't
hesitate too. There is possible improvements to speed up lookuplist
and lookupmap (not going though the whole map basically) but it
require important refactoring and I would prefer not doing too much
things at once since it's a pretty critical peace of code and locking
is the main issue right now.
Thanks,
--
Thomas Mortagne