-
Notifications
You must be signed in to change notification settings - Fork 440
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
internal: cache build info to reduce lock contention in GetGitMetadataTags #2770
internal: cache build info to reduce lock contention in GetGitMetadataTags #2770
Conversation
Reverting to draft to investigate a bit more. |
ec06787
to
048ef48
Compare
BenchmarksBenchmark execution time: 2024-07-12 14:58:20 Comparing candidate commit fcb1ad4 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 1 unstable metrics. |
048ef48
to
1ab3ea6
Compare
1ab3ea6
to
f4ac899
Compare
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.
LGTM, left 2 non-blocking suggestions
Co-authored-by: Eliott Bouhana <[email protected]>
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.
Thanks!
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.
nice approach!
What does this PR do?
Introduces caching code to avoid calling
debug.ReadBuildInfo
multiple times each time a span is finished. It's cached on package initialisation.Note: it's important to know that it's not possible to test
debug.ReadBuildInfo
because test binaries have no debug info, according to golang/go#33976.Motivation
This was detected as an important lock contention area using our Continuous Profiler on one of our busiest services. It should help to reduce lock contention, with potential reduction around 15%.
Reviewer's Checklist
Unsure? Have a question? Request a review!