-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Profiler] Implement interning API #917
Conversation
BenchmarksComparisonBenchmark execution time: 2025-03-25 13:16:58 Comparing candidate commit 73ac3d5 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 2 unstable metrics. CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
BaselineOmitted due to size. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #917 +/- ##
==========================================
- Coverage 72.96% 72.35% -0.61%
==========================================
Files 334 338 +4
Lines 50915 51431 +516
==========================================
+ Hits 37149 37213 +64
- Misses 13766 14218 +452
🚀 New features to boost your workflow:
|
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.
This reminded me of @ivoanjo 's ManagedStringStorage
.
Correct me if I understood it wrong.
- this change uses
strings: StringTable
where ivo's PR usesstring_storage: Option<...<...<ManagedStringStorage>>>
frominternal::Profile
. - we create a new
StringTable
for each Profile, whilestring_storage
persists across Profiles
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.
I have to jump to other things, but figured I'd leave my partial review.
8145a59
to
33380b9
Compare
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
i686-alpine-linux-musl
i686-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Co-authored-by: Taegyun Kim <[email protected]>
What does this PR do?
Adds a new API for adding values to the profiler which interns the value, and then returns a handle to the interned value.
Motivation
The current API has two notable downsides
This new API follows more of a builder pattern: you give a value, intern it, and then get a handle to the interned value which you can then reuse as needed.
Additional Notes
The new API is twice as fast as the old one on the C/C++ example, which do similar work
How to test the change?
The new C++ file that drives the API.