-
Notifications
You must be signed in to change notification settings - Fork 318
Small tweaks to tags map in DDSpanContext #1655
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
Conversation
dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java
Outdated
Show resolved
Hide resolved
|
Is there any impact on the rule processing in the trace processing disruptor? That typically ends up being a hotspot. The |
183c78b to
42bd262
Compare
|
Excellent question @richardstartin . I can actually see an increase in the time being spent in |
42bd262 to
58a437c
Compare
|
I've updated the code and the benchmarks, and also changed the tags interceptor and rules processing to not take the locks repeatedly. |
richardstartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust that the impact on rules processing performance has been taken into account.
|
@richardstartin Yes, the third commit is to fix that. |
This PR consists of three parts that are separate, but build on each other.
CoreSpanBuildertags hash map just to copy them out and insert them into theDDSpanContexttags map.DDSpanContextin most cases is probably not accessed concurrently, change it to a normalHashMapthat is guarded bysynchronizedaccess.These three combined shaves off
25-45%of the time being spent in creating a span and adding tags to it.This is the Bencmark: