YW. I might not be able to get back to this until tonight or tomorrow so feel free to tweak.

Gary

On Mar 1, 2016 1:53 PM, "Remko Popma" <remko.popma@gmail.com> wrote:
Gary, thanks for doing the work on this!

There's no need to cache the thread ID or priority in the ThreadNameCachingStrategy, we can just ask the Thread.currentThread().

The reason the thread name is cached is that Thread.getName() is implemented as a JNI method returning a char[] array, which is then wrapped in a new String. There's significant overhead with that. Obtaining an int/long should not have that drawback.

(Although I haven't checked the implementation on Thread, I hope they're not expensive JNI methods, that would change things...)

Directly calling the relevant methods on Thread also means we don't need to autobox the values which is nice.

Sent from my iPhone

> On 2016/03/02, at 3:43, ggregory@apache.org wrote:
>
> ThreadNameCachingStrategy

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org