perf(trace): encode agentless IDs without formatting - #2452
Conversation
Replace formatting allocations with fixed-width stack buffers for agentless trace, span, parent, and link IDs. With production-deduplicated spans, position-balanced Criterion runs on macOS arm64 improved common HTTP traces by 32.35% and span-link traces by 44.48%.
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: f194c4f | Docs | View more details | Give us feedback! |
BenchmarksComparisonBenchmark execution time: 2026-09-03 11:53:37 Comparing candidate commit f194c4f in PR branch Found 1 performance improvements and 2 performance regressions! Performance is the same for 138 metrics, 0 unstable metrics.
|
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?
Replaces formatting-backed agentless trace, span, parent, and link ID serialization with fixed-width lowercase hexadecimal buffers. Exact wire tests and lasting Criterion workloads cover common HTTP and span-link traces.
Motivation
Formatting allocated temporary strings for every serialized ID in the agentless hot path.
Additional Notes
With production-deduplicated spans, position-balanced Criterion runs improved common HTTP traces by 32.35% and span-link traces by 44.48% on macOS arm64.
How to test the change?
Run
cargo test -p libdd-trace-utils --lib agentless_encoderandcargo bench -p libdd-trace-utils --bench main -- agentless_encoding.