elasticsearch/elasticsearch — pull request #4652 by jpountz (2014-01-08 08:45:19+00:00)
Title: Change the default recycler type for page-based recycling.

Page-based recycling is not thread-local anymore but instead there are several
pools of objects to recycle that threads may use depending on their hashCode.
Each pool is protected by its own lock so up to ${number of pools} threads may
recycle objects concurrently.

Recyclers have also been refactored for better composability, for example there
is a soft recycler that creates a recycler that wraps data around a
SoftReference and a thread-local recycler that can take any factory or recyclers
and instantiates a dedicated instance per thread.

RecyclerBenchmark has been added to try to figure out the overhead of object
recycling depending on the recycler type and the number of threads trying to
recycle objects concurrently.

Close #4647