Skip to content

refactor(profiling): more try_reserve fixes#2010

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
PROF-14651-more-try-reserve
May 19, 2026
Merged

refactor(profiling): more try_reserve fixes#2010
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
PROF-14651-more-try-reserve

Conversation

@morrisonlevi
Copy link
Copy Markdown
Contributor

What does this PR do?

This migrates more Vec code to use try_reserve*.

Makes two helpers, try_clone_optional_tags, and try_into_vec_files (which replaced into_vec_files and fixes some other panics in this helper too)..

Motivation

Trying to reduce the places we panic without breaking APIs.

Additional Notes

This is based on #2002, so that should merge first.

There are still Vec::with_capacity calls in the code, but I think all of the remainder require either API breaks or parallel helpers, which I may investigate in future PRs.

How to test the change?

Should test all the same!

@morrisonlevi morrisonlevi requested a review from a team as a code owner May 18, 2026 17:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/PROF-14651-more-try-reserve

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 1 1 No change (0%)
Total 1 1 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-profiling/src/internal/profile/mod.rs 1 1 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 57 57 No change (0%)
libdd-common 13 13 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 20 20 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 8 8 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 203 203 No change (0%)

About This Report

This 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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 18, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.70%. Comparing base (29bb36d) to head (b573dd3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2010      +/-   ##
==========================================
+ Coverage   72.67%   72.70%   +0.02%     
==========================================
  Files         452      452              
  Lines       74889    74895       +6     
==========================================
+ Hits        54427    54452      +25     
+ Misses      20462    20443      -19     
Components Coverage Δ
libdd-crashtracker 65.27% <ø> (-0.05%) ⬇️
libdd-crashtracker-ffi 37.56% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.00% <ø> (ø)
libdd-data-pipeline-ffi 71.04% <ø> (ø)
libdd-common 79.81% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 73.37% <ø> (+0.02%) ⬆️
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 74.75% <ø> (ø)
libdd-profiling 81.70% <62.50%> (+0.03%) ⬆️
libdd-profiling-ffi 64.79% <84.21%> (+0.27%) ⬆️
libdd-sampling 97.46% <ø> (ø)
datadog-sidecar 29.21% <ø> (ø)
datdog-sidecar-ffi 10.26% <ø> (ø)
spawn-worker 48.86% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.39% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.59% <ø> (ø)
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented May 18, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 62.50%
Overall Coverage: 72.70% (+0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b573dd3 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 18, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.57 MB 7.57 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 81.83 MB 81.75 MB --.08% (-72.93 KB) 💪
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 98.02 MB 97.94 MB --.08% (-84.00 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.01 MB 10.01 MB -0% (-32 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.48 MB 24.47 MB --.06% (-17.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 79.87 KB 79.87 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 180.23 MB 180.01 MB --.12% (-232.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 914.09 MB 913.24 MB --.09% (-863.97 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 7.73 MB 7.73 MB --.01% (-1.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 79.87 KB 79.87 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.16 MB 23.15 MB --.06% (-16.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 45.36 MB 45.34 MB --.02% (-11.23 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.10 MB 21.09 MB --.07% (-15.50 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 81.11 KB 81.11 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 184.44 MB 184.21 MB --.12% (-240.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 900.36 MB 898.93 MB --.15% (-1.42 MB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 5.99 MB 5.99 MB --.01% (-1.00 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 81.11 KB 81.11 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 24.80 MB 24.80 MB --.03% (-8.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 42.85 MB 42.85 MB --.01% (-8.06 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 72.93 MB 72.86 MB --.09% (-70.85 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.42 MB 8.42 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.71 MB 90.63 MB --.08% (-82.31 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.06 MB 10.06 MB -0% (-176 B) 👌

Base automatically changed from PROF-14651-oob-label-set-id to main May 18, 2026 18:31
@morrisonlevi morrisonlevi force-pushed the PROF-14651-more-try-reserve branch from fa94737 to b573dd3 Compare May 18, 2026 18:52
@morrisonlevi
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented May 18, 2026

View all feedbacks in Devflow UI.

2026-05-18 23:26:17 UTC ℹ️ Start processing command /merge


2026-05-18 23:26:22 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 49m (p90).


2026-05-19 00:09:01 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit 0ac6a82:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

@morrisonlevi
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented May 19, 2026

View all feedbacks in Devflow UI.

2026-05-19 00:18:06 UTC ℹ️ Start processing command /merge


2026-05-19 00:18:11 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 49m (p90).


2026-05-19 00:59:54 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants