Description
Current implementation of ThreadContextDataInjector.ForDefaultThreadContextMap::injectContextData always copies all elements from the ThreadContext into the reused StringMap of the LogEvent.
Since the DefaultThreadContextMap is used in web applications (when non-JDK thread-locals are not available and Log4j is not garbage-free), we don't need to worry about creating additional objects. We can speed up the injectContextData method by wrapping the context data Map<String, String> in a decorator object that implements the StringMap interface.
Attachments
Attachments
Issue Links
- is superceded by
-
LOG4J2-1607 Improve performance of SortedArrayStringMap data structure
- Closed