feat(profiling-ffi): ProfilesDictionary_insert_strs#1764
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom Mar 19, 2026
Merged
feat(profiling-ffi): ProfilesDictionary_insert_strs#1764gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom
Conversation
Batch variant of ddog_prof_ProfilesDictionary_insert_str that interns a slice of CharSlices into an existing ProfilesDictionary in a single call, writing the resulting StringId2s to a caller-provided MutSlice.
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
Contributor
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1764 +/- ##
==========================================
+ Coverage 71.44% 71.46% +0.01%
==========================================
Files 430 430
Lines 64152 64214 +62
==========================================
+ Hits 45835 45891 +56
- Misses 18317 18323 +6
🚀 New features to boost your workflow:
|
taegyunkim
approved these changes
Mar 19, 2026
Contributor
taegyunkim
left a comment
There was a problem hiding this comment.
Thanks for adding the API!
Contributor
Author
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
bwoebi
added a commit
that referenced
this pull request
Mar 20, 2026
…-unprocessed * 'main' of github.com:DataDog/libdatadog: feat(sidecar): add thread mode as fallback connection for restricted environments (#1447) feat(profiling-ffi): ProfilesDictionary_insert_strs (#1764) chore(release): merge release branch to main (#1760) fix(libdd-crashtracker-ffi)!: add missing fields for endpoint configuration (#1758) ci: prevent running macos tests on release branches (#1765) chore(datadog-tracer-flare): remove unnecessary features/deps (#1761) fix(profiling-ffi): Windows extern statics need __declspec(dllimport) (#1468) feat(profiling): thread id/name as well-known strs (#1757) ci: switch to ephemeral branches (#1731) chore(crashtracker): use weaker mem ordering for OP_COUNTERS (#1744) refactor(trace-utils)!: change header name type to accept dynamic values (#1722)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a batch variant of
ddog_prof_ProfilesDictionary_insert_strcalledddog_prof_ProfilesDictionary_insert_strsthat interns a slice of CharSlices into an existing ProfilesDictionary in a single call, writing the resulting StringId2s to a caller-provided MutSlice.Motivation
Every profiler adopting
ProfilesDictionaryneeds to insert their known label keys, so may as well make it convenient.Additional Notes
Taegyun and I thought of this while going over some memory allocations, and they had unexpected large allocations for adding 3 label keys. This is because the profile was aggregated over multiple processes, but also it reports the full 1 MiB of virtual memory per shard of the sharded set, and these label keys were the first in their respective buckets. This function doesn't really change that, but it at least makes it more convenient to intern all label strings up front.
How to test the change?
Tests were added to existing suites, can just run
cargo testor nextest etc.