feat(internal/samplernames): decision maker string conversion by lookup table#4424
feat(internal/samplernames): decision maker string conversion by lookup table#4424
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-02-17 13:58:36 Comparing candidate commit b662010 in PR branch Found 4 performance improvements and 0 performance regressions! Performance is the same for 152 metrics, 8 unstable metrics.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
dario.castane@datadoghq.com unqueued this merge request |
|
/remove |
|
View all feedbacks in Devflow UI.
|
What does this PR do?
Replaces
samplerToDMfunction by aSamplerNamemethodDecisionMakerthat returns the string representation following the"-" + strconv.Itoa(int(sampler))behavior.Motivation
Add a small improvement for warm path when sampling spans. It was found while statically analyzing the codebase for potential improvement opportunities on spans.
strconv.Itoafalls back to a very fastsmallfunction that returns a preallocated representation for most of the values modeled bySamplerName, but this implementation is faster for all of them.Microbenchmarks
oldmodels the previousgetRateimplementation with string concatenation.Reviewer's Checklist
If this interacts with the agent in a new way, a system test has been added.make lintlocally.make testlocally.Add an appropriate team label so this PR gets put in the right place for the release notes.make generatelocally.Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by runningmake fix-moduleslocally.Unsure? Have a question? Request a review!