Skip to content
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

tracing: optimize span.Finish #73398

Merged

Conversation

andreimatei
Copy link
Contributor

Don't read the clock unnecessarily and also use the more efficient
timeutil.Since(t) when reading it is necessary.

This clock reading was showing up in profiles when running with tracing
enabled, and is confirmed by a micro-benchmark:

Tracer_StartSpanCtx/opts=real-32 696ns ± 1% 593ns ± 1% -14.74% (p=0.008 n=5+5)

Release note: None

Don't read the clock unnecessarily and also use the more efficient
timeutil.Since(t) when reading it is necessary.

This clock reading was showing up in profiles when running with tracing
enabled, and is confirmed by a micro-benchmark:

Tracer_StartSpanCtx/opts=real-32                  696ns ± 1%     593ns ± 1%  -14.74%  (p=0.008 n=5+5)

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rimadeodhar rimadeodhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @abarganier)

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @abarganier)

@craig
Copy link
Contributor

craig bot commented Dec 7, 2021

Build succeeded:

@craig craig bot merged commit 66b513c into cockroachdb:master Dec 7, 2021
@andreimatei andreimatei deleted the tracing.optimize-finish-duration branch January 22, 2022 22:05
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.

3 participants