Reduce the number of times ThreadLocal is accessed on critical path