feat(profiling): make dictionary ids comparable in api2#1570
feat(profiling): make dictionary ids comparable in api2#1570morrisonlevi wants to merge 2 commits intopr1/add-samples-benchmarkfrom
Conversation
Add Eq/PartialEq/Hash for MappingId2, FunctionId2, and Location2 so api2 locations can be deduplicated by handle identity. Document that comparisons are only intended for ids from the same ProfilesDictionary. Co-authored-by: Cursor <cursoragent@cursor.com>
Add minimal unit tests for FunctionId2, MappingId2, and Location2 equality and hash semantics based on dictionary-backed handle identity. Co-authored-by: Cursor <cursoragent@cursor.com>
📚 Documentation Check Results📦
|
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. |
🔒 Cargo Deny Results📦
|
🔒 Cargo Deny Results📦
|
BenchmarksComparisonBenchmark execution time: 2026-02-13 22:39:38 Comparing candidate commit 8c3b6d0 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 56 metrics, 2 unstable metrics. scenario:tags/replace_trace_tags
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
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pr1/add-samples-benchmark #1570 +/- ##
=============================================================
+ Coverage 70.92% 70.97% +0.04%
=============================================================
Files 424 424
Lines 61788 61878 +90
=============================================================
+ Hits 43821 43915 +94
+ Misses 17967 17963 -4
🚀 New features to boost your workflow:
|
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
|
What does this PR do?
Adds comparability and hashability for dictionary-backed
api2identity types.Specifically, this PR adds
Eq/PartialEq/Hashfor:FunctionId2MappingId2api2::Location2Documents that these comparisons are intended for values produced by the
same
ProfilesDictionary.Motivation
I intend to use this in a future PR to optimize the internals of the Profile.
I'm opening a separate PR to keep PRs smaller and more reviewable.
Additional Notes
This is currently stacked on another PR.
How to test the change?
levi/api2-eq-hash.cargo check -p libdd-profilingcargo check -p libdd-profiling --benchesapi2::Location2/FunctionId2/MappingId2can be used inEq/Hashcontexts for same-dictionary IDs