Skip to content

Cache DSM pathway.hash strings and reuse checkpoint consumers - #13011

Draft
labbati wants to merge 1 commit into
masterfrom
labbati/dsm-pathway-hash-cache
Draft

labbati wants to merge 1 commit into
masterfrom
labbati/dsm-pathway-hash-cache

Conversation

@labbati

@labbati labbati commented Oct 23, 2026

Copy link
Copy Markdown
Member

What Does This Do

Reduces per-message allocation in Data Streams Monitoring (DSM) hot paths:

  • Caches the decimal pathway.hash tag string (new PathwayHashStrings) instead of calling Long.toUnsignedString on every message.
  • Reuses the checkpoint consumer in DataStreamsPropagator / DefaultDataStreamsMonitoring instead of allocating a new one per message.

Tag values and payloads are identical to before. Adds PathwayHashStringsTest.

Motivation

Part of work to lower DSM overhead so it can be enabled by default. These two sites allocate on every produced/consumed message.

Additional Notes

Performance (indicative only): this commit was measured locally as part of a 3-commit stack that also included other allocation reductions not in this PR. On a noisy laptop, DSM overhead relative to APM's own overhead went from 52.9% to 11.7% for the whole stack. That number is not attributable to this commit alone. Per-commit evidence is the removal of the allocation sites above. Final numbers will come from the benchmarking platform.

Tests: ./gradlew :dd-trace-core:test --tests '*datastreams*' passes locally; Spotless applied.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@labbati labbati added type: feature Enhancements and improvements tag: no release notes Changes to exclude from release notes comp: data streams Data Streams Monitoring tag: ai generated Largely based on code generated by an AI or LLM labels Oct 23, 2026
@datadog-datadog-us1-prod

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.99 s 13.98 s [-0.8%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.89 s 12.94 s [-1.0%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.21 s 17.11 s [-0.3%; +1.4%] (no difference)
startup:petclinic:iast:Agent 17.01 s 17.13 s [-1.5%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 16.72 s 16.94 s [-2.2%; -0.4%] (maybe better)
startup:petclinic:sca:Agent 17.27 s 17.14 s [-0.1%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 16.14 s 16.14 s [-0.8%; +0.9%] (no difference)

Commit: ba6bccb3 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

This branch has not been deployed

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

Labels

comp: data streams Data Streams Monitoring tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant