-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor for better performance #115
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
//------------------------------------------------------------------------------ | ||
// constructor | ||
//------------------------------------------------------------------------------ | ||
LightStepImmutableSpanContext::LightStepImmutableSpanContext( |
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.
nit: I would be slightly inclined to remove the LightStep prefix since you're in namespace lightstep.
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.
Yeah, it's a little redundant.
I used names like LightStepSpan, LightStepTracer, etc to keep them from clashing with the opentracing names in case you happen to use both namespaces; then chose this name to be consistent. But maybe I should rename them all.
I'll merge in as is for now and maybe make a separate PR to rename everything.
Refactors code for a modest performance improvement. These are benchmarks from before and after. The benchmarks from the CircleCI machines can be a little noisy, but I got similar improvements testing on my laptop.
This is the summary of the changes:
collector::Span
protobuf object directly to avoid copying in theFinish
method.SetTag
is called twice with the same key, both values are sent and the satellite is expected to take the latest version.LightStepSpanContext
so thatcollector::Span
can be used to store the context and only a single mutex is required.