Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
A FastThreadLocal object is an idea I've been circling with a common SolrThread for executors that can actually hold thread local type objects itself.
Netty has implemented a similar and more generic solution around this idea that other projects have also borrowed called FastThreadLocal.
This class behaves very much like a typle ThreadLocal, but if the thread object is of the right type, the majority of their ThreadLocal usage will directly fetch from the associated Thread class, whereas other Thread types will fall back to the typical ThreadLocal binding approach.
The FastThreadLocal implementation has been found to be a performance improvement when access may be relatively frequent.
Another thing they do is create a few common data structures and buffers for simple and effect object reuse in key places (eg, a byte buffer, a char buffer, a StringBulider, etc).
https://netty.io/4.0/api/io/netty/util/concurrent/FastThreadLocal.html