Skip to content

perf(profiling): observation map doesn't need HashDos protection#1988

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
levi/AggregatedObservations-fxhash
May 15, 2026
Merged

perf(profiling): observation map doesn't need HashDos protection#1988
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
levi/AggregatedObservations-fxhash

Conversation

@morrisonlevi
Copy link
Copy Markdown
Contributor

@morrisonlevi morrisonlevi commented May 14, 2026

What does this PR do?

This changes AggregatedObservations's HashMap to use FxHasher for its hasher instead of the default.

Motivation

HashDos protection comes built-in with the default hasher type, and it's unnecessary here. It's more performant in general to use FxHasher.

Additional Notes

My motivation here isn't actually performance, although it's true; I want a deterministic hasher between runs so iteration order is preserved. I am trying to make another version of the ddog_prof_Profile_serialize function. I want bit-for-bit fuzz accuracy for property testing it, but with a HashDos protected HashMap, the order of iteration will change from map to map.

But even if this other work doesn't land, it's true we're paying for HashDos protection that we don't need, which is why I opened this as its own PR.

How to test the change?

Test as regularly done--this shouldn't change anything.

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

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/levi/AggregatedObservations-fxhash

Summary by Rule

Rule Base Branch PR Branch Change
expect_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/observation/observations.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.

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

datadog-datadog-prod-us1 Bot commented May 14, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 72.70% (+0.00%)

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.70%. Comparing base (a87dac4) to head (58e90ad).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1988   +/-   ##
=======================================
  Coverage   72.69%   72.70%           
=======================================
  Files         452      452           
  Lines       74893    74893           
=======================================
+ Hits        54446    54449    +3     
+ Misses      20447    20444    -3     
Components Coverage Δ
libdd-crashtracker 65.31% <ø> (+0.02%) ⬆️
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.34% <ø> (ø)
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.22% <ø> (ø)
libdd-profiling 81.59% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 64.51% <ø> (ø)
libdd-sampling 97.46% <ø> (ø)
datadog-sidecar 28.97% <ø> (ø)
datdog-sidecar-ffi 9.08% <ø> (ø)
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.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 14, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 81.84 MB 81.83 MB --.01% (-8.64 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.57 MB 7.57 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.01 MB 10.01 MB -0% (-104 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 98.04 MB 98.03 MB -0% (-3.99 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.49 MB 24.49 MB 0% (0 B) 👌
/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.24 MB 180.26 MB +.01% (+24.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 914.26 MB 914.26 MB +0% (+2.10 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 7.73 MB 7.73 MB -0% (-512 B) 👌
/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.16 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 45.36 MB 45.35 MB -0% (-2.52 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.09 MB 21.09 MB -0% (-1.00 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.37 MB 184.36 MB -0% (-8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 900.37 MB 900.37 MB +0% (+798 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 5.99 MB 5.99 MB --.03% (-2.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% (-5.03 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 72.94 MB 72.93 MB -0% (-6.97 KB) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.42 MB 8.42 MB --.04% (-4.00 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.71 MB 90.70 MB -0% (-2.79 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.06 MB 10.06 MB -0% (-80 B) 👌

@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 15, 2026

View all feedbacks in Devflow UI.

2026-05-15 13:39:53 UTC ℹ️ Start processing command /merge


2026-05-15 13:39:59 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-05-15 14:26:41 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit d33f94d:

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

Not space left on device

Retrying merge.

@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 15, 2026

View all feedbacks in Devflow UI.

2026-05-15 14:44:47 UTC ℹ️ Start processing command /merge


2026-05-15 14:44:52 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-05-15 15:50:01 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit d49a56c:

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.

gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request May 15, 2026
… disk space (#2001)

# What does this PR do?

Since #1928 we've been intermittently running out of disk space on our GH runners for tests. This PR bumps the size of our ubuntu runners, which includes more disk space and should solve this issue.  

# Motivation

@morrisonlevi was seeing consistent failures on the MQ when running the full test suite on this PR: #1988

# Additional Notes

Anything else we should know when reviewing?

# How to test the change?

Describe here in detail how the change can be validated.


Co-authored-by: edmund.kump <edmund.kump@datadoghq.com>
@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 15, 2026

View all feedbacks in Devflow UI.

2026-05-15 18:51:44 UTC ℹ️ Start processing command /merge


2026-05-15 18:51:51 UTC ℹ️ MergeQueue: waiting for PR to be ready

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.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-05-15 19:25:08 UTC ℹ️ MergeQueue: merge request added to the queue

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


2026-05-15 20:07:55 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.

4 participants