CachingDriverFactory.ThreadLocalCache performance #421

schillingr opened this Issue Feb 17, 2016 · 1 comment


None yet

2 participants


When running UI tests in a thread (thread per Specification), the synchronized nature of ThreadLocalCache impacts performance dramatically. Since ThreadLocalCache uses a ThreadLocal as a backing store it is already thread-safe and the synchronized get() shouldn't be necessary.

In local testing it saved ~7 minutes of runtime @ 50 threads (1 grid node per thread), which equated to about a 30% speed improvement.

@erdi erdi added the Improvement label Feb 20, 2016
@erdi erdi added this to the 0.13.1 milestone Feb 20, 2016
@erdi erdi self-assigned this Feb 20, 2016
@erdi erdi added a commit to geb/geb that closed this issue Feb 20, 2016
@erdi erdi Don't unnecessarily synchronize methods of CachingDriverFactory.Threa…
…dLocalCache as it being backed by a ThreadLocal makes them thread safe.

Fixes geb/issues#421
erdi commented Feb 20, 2016

Thanks for reporting @schillingr. You are right, synchronizing these methods was totally unnecessary. The fix will be part of 0.13.1 which will be released imminently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment