JodaOrg/joda-time — pull request #126 by CodingFabian (2014-02-17 21:11:22+00:00)
Title: Avoid lock contention in chonology cache

This PR contains 2 commits.
The first one replaces all synchronized Maps with ConcurrentHashMap and is a straightforward diff (looking simpler in SourceTree than on GH due to indentation changes).
The second one does the same for GJChronology but I decided to create a special key for every possible GJChronology instead of using the zone as key and iterating over array lists looking for the right entry. With the original code it was difficult to get rid of synchronized, as the object from the cache was iterated and modified.
See also the commit messages of each commit.
Is this change worth it? in my opinion yes:
https://gist.github.com/CodingFabian/9058922
ISOChronology is already optimized using the "fast" cache.
Every other implementation gets less throughput when having multithreaded access.
With my commit the single threaded performance almost doubles, and there is a linar scaling with number of threads.