-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogbackMDCAdapter Performance #812
Comments
@mosesn The MDC map is copied into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: