You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been using LogbackMDCAdapter, but recently found that it's copying around a lot of hashmaps. We're currently trying out LogbackMDCAdapterSimple, and it seems better and we found that it does even more copying.
Question
Why does Logback provide both LogbackMDCAdapterSimple and LogbackMDCAdapter? Would you consider just consolidating on LogbackMDCAdapterSimple?
Proposed Improvement
Since LogbackMDCAdapterSimple uses a thread local, it doesn't seem like it actually needs to use copy-on-write semantics to keep the map safe. What about using a simple ThreadLocal<Map<String, String>> where the map is mutable and we update it directly?
Result
We require fewer intermediate data structures as we assemble MDC.
The text was updated successfully, but these errors were encountered:
Problem
We've been using LogbackMDCAdapter, but recently found that it's copying around a lot of hashmaps. We're currently trying out LogbackMDCAdapterSimple,
and it seems betterand we found that it does even more copying.Question
Why does Logback provide both LogbackMDCAdapterSimple and LogbackMDCAdapter?
Would you consider just consolidating on LogbackMDCAdapterSimple?Proposed Improvement
Since LogbackMDCAdapterSimple uses a thread local, it doesn't seem like it actually needs to use copy-on-write semantics to keep the map safe. What about using a simple ThreadLocal<Map<String, String>> where the map is mutable and we update it directly?
Result
We require fewer intermediate data structures as we assemble MDC.
The text was updated successfully, but these errors were encountered: