Skip to content

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

Merged
merged 17 commits into from
Aug 31, 2018
Merged

Refactor for better performance #115

merged 17 commits into from
Aug 31, 2018

Conversation

rnburn
Copy link
Contributor

@rnburn rnburn commented Aug 22, 2018

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:

  • Removes intermediate data structures in favor of writing to the collector::Span protobuf object directly to avoid copying in the Finish method.
  • Drops indexing done on tags. If SetTag is called twice with the same key, both values are sent and the satellite is expected to take the latest version.
  • Refactors the LightStepSpanContext so that collector::Span can be used to store the context and only a single mutex is required.

@rnburn rnburn changed the title (WIP) Refactoring for better performance Refactor for better performance Aug 22, 2018
@rnburn rnburn requested a review from jmacd August 22, 2018 22:51
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
LightStepImmutableSpanContext::LightStepImmutableSpanContext(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@rnburn rnburn merged commit 780c0d9 into lightstep:master Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants