Refactor for better performance#115
Merged
Merged
Conversation
jmacd
approved these changes
Aug 27, 2018
| //------------------------------------------------------------------------------ | ||
| // constructor | ||
| //------------------------------------------------------------------------------ | ||
| LightStepImmutableSpanContext::LightStepImmutableSpanContext( |
Contributor
There was a problem hiding this comment.
nit: I would be slightly inclined to remove the LightStep prefix since you're in namespace lightstep.
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::Spanprotobuf object directly to avoid copying in theFinishmethod.SetTagis called twice with the same key, both values are sent and the satellite is expected to take the latest version.LightStepSpanContextso thatcollector::Spancan be used to store the context and only a single mutex is required.