Skip to content

Conversation

bwoebi
Copy link
Contributor

@bwoebi bwoebi commented Sep 29, 2025

Also move Span structures to v04, to make space for v1 spans (which will eventually become the new default). TraceData is also going to be used in the V1 implementation, to carry around byte arrays and strings alike, separate from the indexed offsets into the big vector.
This trivially allows directly working on tinybytes data or u8 slices, depending on the input, rather than requiring a copy-conversion at the end for tinybytes input. This is a major performance penalty (benchmarks say about 20% gain - I'm really confused why the regression introduced by #1004 was deemed acceptable).

This also addresses "APMSP-1941 - Replace Bytes with a wrapper that borrows the underlying".

Note that this PR partially reverts #1139 by @shreyamalpani - but instead provides the ability to pass an endpoint directly when sending.
This was done by the deliberate choice to remove Clone from Span, which is quite an expensive operation and should simply never be done. Especially the goal is for v1 spans to possibly store the backing storage for strings alongside the actual TracerPayload (which v1 has), at which point such an operation would be prohibitively expensive.

Also move Span structures to v04, to make space for v1 spans (which will eventually become the new default).
TraceData is also going to be used in the V1 implementation, to carry around byte arrays and strings alike, separate from the indexed offsets into the big vector.

Signed-off-by: Bob Weinand <[email protected]>
@pr-commenter
Copy link

pr-commenter bot commented Sep 29, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-10-01 12:00:29

Comparing candidate commit 2f92752 in PR branch bob/tracedata with baseline commit e741848 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 2 unstable metrics.

scenario:benching deserializing traces from msgpack to their internal representation

  • 🟩 execution_time [-14.003ms; -13.331ms] or [-22.423%; -21.348%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 156.508µs 157.325µs ± 0.445µs 157.259µs ± 0.156µs 157.434µs 157.782µs 158.277µs 161.384µs 2.62% 5.375 42.697 0.28% 0.031µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [157.264µs; 157.387µs] or [-0.039%; +0.039%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2597 execution_time 6.232ms 6.287ms ± 0.038ms 6.277ms ± 0.016ms 6.297ms 6.370ms 6.418ms 6.474ms 3.13% 2.171 6.327 0.61% 0.003ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2597 execution_time [6.282ms; 6.292ms] or [-0.084%; +0.084%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 34.515µs 35.107µs ± 1.086µs 34.594µs ± 0.035µs 34.722µs 37.426µs 37.463µs 38.850µs 12.30% 1.730 1.159 3.09% 0.077µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [34.956µs; 35.257µs] or [-0.429%; +0.429%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.891µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.916µs 3.918µs 3.919µs 0.20% -1.660 15.098 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255180045.140op/s 255672348.048op/s ± 174050.644op/s 255690769.563op/s ± 104821.249op/s 255795475.661op/s 255843189.040op/s 255898966.713op/s 256993267.219op/s 0.51% 1.689 15.346 0.07% 12307.239op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 76.718µs 78.519µs ± 0.752µs 78.454µs ± 0.456µs 78.982µs 79.861µs 80.220µs 80.685µs 2.84% 0.180 -0.066 0.96% 0.053µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12393840.223op/s 12736947.083op/s ± 121805.912op/s 12746268.169op/s ± 74291.168op/s 12813676.734op/s 12930620.477op/s 13010833.545op/s 13034783.830op/s 2.26% -0.126 -0.077 0.95% 8612.979op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 69.858µs 70.967µs ± 0.651µs 70.885µs ± 0.414µs 71.357µs 72.179µs 72.798µs 72.843µs 2.76% 0.573 -0.030 0.92% 0.046µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13728137.697op/s 14092242.330op/s ± 128641.041op/s 14107449.094op/s ± 82431.579op/s 14184501.781op/s 14292469.908op/s 14306854.395op/s 14314729.532op/s 1.47% -0.528 -0.099 0.91% 9096.295op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.891µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.916µs 3.917µs 3.918µs 0.17% -1.774 13.254 0.07% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255252091.399op/s 255657931.304op/s ± 181808.377op/s 255678736.269op/s ± 122583.186op/s 255781284.988op/s 255870380.796op/s 255932765.383op/s 257007113.949op/s 0.52% 1.800 13.483 0.07% 12855.794op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 66.809µs 68.070µs ± 0.571µs 68.069µs ± 0.373µs 68.430µs 69.057µs 69.399µs 69.673µs 2.36% 0.177 -0.137 0.84% 0.040µs 1 200
credit_card/is_card_number/378282246310005 throughput 14352688.419op/s 14691791.673op/s ± 123155.022op/s 14690946.188op/s ± 80914.894op/s 14777661.039op/s 14892589.931op/s 14962061.435op/s 14968050.797op/s 1.89% -0.131 -0.163 0.84% 8708.375op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.144µs 52.201µs ± 0.034µs 52.196µs ± 0.023µs 52.221µs 52.258µs 52.293µs 52.319µs 0.23% 0.755 0.542 0.06% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19113557.027op/s 19156804.975op/s ± 12337.808op/s 19158450.111op/s ± 8438.131op/s 19166093.265op/s 19173409.645op/s 19177030.520op/s 19177560.337op/s 0.10% -0.751 0.532 0.06% 872.415op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.038µs ± 0.016µs 6.035µs ± 0.003µs 6.038µs 6.072µs 6.088µs 6.182µs 2.44% 5.306 38.485 0.26% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 161768112.781op/s 165612990.978op/s ± 420068.514op/s 165711235.258op/s ± 80820.786op/s 165789630.020op/s 165857020.988op/s 165903572.477op/s 165920425.285op/s 0.13% -5.213 37.152 0.25% 29703.329op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.893µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.913µs 3.916µs 3.917µs 3.918µs 0.17% -1.416 10.630 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255209105.286op/s 255653600.869op/s ± 170904.389op/s 255649522.002op/s ± 100336.434op/s 255755243.149op/s 255899203.456op/s 255953537.336op/s 256849736.475op/s 0.47% 1.437 10.795 0.07% 12084.765op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.035µs 64.430µs ± 0.159µs 64.430µs ± 0.107µs 64.522µs 64.710µs 64.788µs 65.030µs 0.93% 0.470 0.469 0.25% 0.011µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15377434.699op/s 15520707.754op/s ± 38339.833op/s 15520684.645op/s ± 25725.274op/s 15551753.851op/s 15575185.938op/s 15590702.688op/s 15616428.483op/s 0.62% -0.454 0.432 0.25% 2711.036op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 57.800µs 58.059µs ± 0.162µs 58.021µs ± 0.090µs 58.143µs 58.394µs 58.503µs 58.543µs 0.90% 0.922 0.272 0.28% 0.011µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 17081496.908op/s 17224133.832op/s ± 47829.713op/s 17235054.012op/s ± 26637.117op/s 17258349.562op/s 17284467.227op/s 17293076.615op/s 17300955.013op/s 0.38% -0.911 0.247 0.28% 3382.071op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.922µs 3.922µs 0.27% -0.137 5.505 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254955599.722op/s 255606405.084op/s ± 197904.098op/s 255632069.052op/s ± 108242.870op/s 255731286.049op/s 255837971.548op/s 255891453.732op/s 256748023.111op/s 0.44% 0.154 5.579 0.08% 13993.933op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.577µs 54.848µs ± 0.218µs 54.774µs ± 0.114µs 54.964µs 55.261µs 55.522µs 55.937µs 2.12% 1.552 3.415 0.40% 0.015µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17877142.998op/s 18232505.794op/s ± 71912.273op/s 18256729.727op/s ± 38093.753op/s 18284506.629op/s 18311367.245op/s 18318596.859op/s 18322903.630op/s 0.36% -1.516 3.223 0.39% 5084.966op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.152µs 52.204µs ± 0.035µs 52.199µs ± 0.020µs 52.220µs 52.252µs 52.299µs 52.426µs 0.43% 2.130 10.132 0.07% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19074487.962op/s 19155688.431op/s ± 12650.577op/s 19157347.124op/s ± 7422.239op/s 19164611.108op/s 19170946.431op/s 19174319.948op/s 19174775.583op/s 0.09% -2.115 10.019 0.07% 894.531op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.027µs 6.036µs ± 0.015µs 6.034µs ± 0.002µs 6.037µs 6.043µs 6.095µs 6.183µs 2.47% 6.972 56.282 0.25% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 161741237.642op/s 165664323.728op/s ± 412203.932op/s 165740639.605op/s ± 67135.449op/s 165797538.692op/s 165874041.680op/s 165886111.643op/s 165913879.582op/s 0.10% -6.900 55.233 0.25% 29147.220op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255648226.303op/s; 255696469.793op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [78.415µs; 78.623µs] or [-0.133%; +0.133%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12720065.955op/s; 12753828.211op/s] or [-0.133%; +0.133%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [70.877µs; 71.057µs] or [-0.127%; +0.127%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14074413.919op/s; 14110070.741op/s] or [-0.127%; +0.127%] None None None
credit_card/is_card_number/37828224631 execution_time [3.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631 throughput [255632734.412op/s; 255683128.197op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.991µs; 68.149µs] or [-0.116%; +0.116%] None None None
credit_card/is_card_number/378282246310005 throughput [14674723.572op/s; 14708859.775op/s] or [-0.116%; +0.116%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.196µs; 52.205µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19155095.073op/s; 19158514.876op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.036µs; 6.040µs] or [-0.036%; +0.036%] None None None
credit_card/is_card_number/x371413321323331 throughput [165554773.522op/s; 165671208.434op/s] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ throughput [255629915.165op/s; 255677286.574op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [64.408µs; 64.453µs] or [-0.034%; +0.034%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15515394.222op/s; 15526021.287op/s] or [-0.034%; +0.034%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.036µs; 58.081µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17217505.093op/s; 17230762.570op/s] or [-0.038%; +0.038%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255578977.480op/s; 255633832.689op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.818µs; 54.878µs] or [-0.055%; +0.055%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18222539.444op/s; 18242472.143op/s] or [-0.055%; +0.055%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.199µs; 52.209µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19153935.182op/s; 19157441.679op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.034µs; 6.038µs] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165607196.227op/s; 165721451.228op/s] or [-0.034%; +0.034%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.160µs 5.234µs ± 0.065µs 5.214µs ± 0.034µs 5.258µs 5.365µs 5.375µs 5.377µs 3.13% 0.984 -0.383 1.25% 0.005µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.225µs; 5.243µs] or [-0.173%; +0.173%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 248.199ns 257.880ns ± 10.832ns 252.870ns ± 3.234ns 260.869ns 279.580ns 290.070ns 294.144ns 16.32% 1.546 1.480 4.19% 0.766ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [256.378ns; 259.381ns] or [-0.582%; +0.582%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 86.444µs 86.985µs ± 0.166µs 86.982µs ± 0.071µs 87.043µs 87.154µs 87.424µs 88.607µs 1.87% 4.708 44.493 0.19% 0.012µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [86.962µs; 87.008µs] or [-0.027%; +0.027%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.409µs 2.436µs ± 0.019µs 2.432µs ± 0.008µs 2.439µs 2.483µs 2.495µs 2.496µs 2.60% 1.400 1.706 0.77% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.433µs; 2.439µs] or [-0.107%; +0.107%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 10.480ms 10.510ms ± 0.018ms 10.508ms ± 0.010ms 10.519ms 10.538ms 10.567ms 10.604ms 0.91% 1.669 5.645 0.17% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.508ms; 10.513ms] or [-0.023%; +0.023%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 534.396µs 535.034µs ± 0.560µs 534.975µs ± 0.227µs 535.206µs 535.742µs 535.973µs 541.057µs 1.14% 6.386 65.284 0.10% 0.040µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1848235.712op/s 1869043.769op/s ± 1942.376op/s 1869247.460op/s ± 792.951op/s 1869997.962op/s 1870966.568op/s 1871233.501op/s 1871273.139op/s 0.11% -6.303 64.089 0.10% 137.347op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 379.543µs 380.312µs ± 0.406µs 380.241µs ± 0.200µs 380.479µs 380.927µs 381.183µs 383.220µs 0.78% 2.199 12.113 0.11% 0.029µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2609468.923op/s 2629426.095op/s ± 2798.424op/s 2629911.632op/s ± 1385.414op/s 2631126.177op/s 2633064.867op/s 2633635.561op/s 2634749.087op/s 0.18% -2.170 11.849 0.11% 197.878op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 193.620µs 194.257µs ± 0.398µs 194.221µs ± 0.141µs 194.359µs 194.606µs 195.713µs 198.388µs 2.15% 6.248 58.659 0.20% 0.028µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5040630.132op/s 5147842.874op/s ± 10418.047op/s 5148784.284op/s ± 3726.384op/s 5152732.937op/s 5157295.161op/s 5162226.587op/s 5164761.323op/s 0.31% -6.117 56.816 0.20% 736.667op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.117µs 36.256µs ± 0.055µs 36.256µs ± 0.036µs 36.289µs 36.347µs 36.420µs 36.424µs 0.46% 0.296 0.272 0.15% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 27454633.585op/s 27581754.684op/s ± 41891.827op/s 27581503.939op/s ± 27273.653op/s 27611355.884op/s 27648080.078op/s 27672870.620op/s 27687898.193op/s 0.39% -0.286 0.260 0.15% 2962.199op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 44.976µs 45.164µs ± 0.173µs 45.144µs ± 0.129µs 45.272µs 45.391µs 45.548µs 46.397µs 2.78% 2.338 13.014 0.38% 0.012µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21553298.313op/s 22141734.258op/s ± 84179.181op/s 22151438.804op/s ± 63318.466op/s 22216660.447op/s 22232387.913op/s 22233593.580op/s 22233943.079op/s 0.37% -2.231 12.083 0.38% 5952.367op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [534.956µs; 535.111µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1868774.575op/s; 1869312.964op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [380.255µs; 380.368µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2629038.260op/s; 2629813.929op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [194.202µs; 194.312µs] or [-0.028%; +0.028%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5146399.033op/s; 5149286.716op/s] or [-0.028%; +0.028%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [36.248µs; 36.264µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27575948.880op/s; 27587560.489op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.140µs; 45.188µs] or [-0.053%; +0.053%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [22130067.833op/s; 22153400.683op/s] or [-0.053%; +0.053%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 17.415µs 25.490µs ± 10.309µs 17.613µs ± 0.135µs 34.827µs 42.519µs 51.106µs 75.875µs 330.79% 1.118 1.526 40.34% 0.729µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [24.062µs; 26.919µs] or [-5.605%; +5.605%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching serializing traces from their internal representation to msgpack execution_time 14.820ms 14.877ms ± 0.030ms 14.872ms ± 0.013ms 14.886ms 14.916ms 14.998ms 15.078ms 1.39% 3.024 14.436 0.20% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching serializing traces from their internal representation to msgpack execution_time [14.873ms; 14.881ms] or [-0.027%; +0.027%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 186.730µs 187.180µs ± 0.408µs 187.118µs ± 0.123µs 187.262µs 187.526µs 188.351µs 190.881µs 2.01% 5.994 46.875 0.22% 0.029µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5238856.494op/s 5342467.449op/s ± 11508.886op/s 5344207.371op/s ± 3511.550op/s 5347183.075op/s 5352385.866op/s 5353585.056op/s 5355318.702op/s 0.21% -5.910 45.866 0.21% 813.801op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.604µs 17.695µs ± 0.042µs 17.693µs ± 0.028µs 17.723µs 17.759µs 17.792µs 17.834µs 0.80% 0.281 -0.062 0.24% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 56073456.228op/s 56513225.554op/s ± 133658.097op/s 56520725.545op/s ± 90793.413op/s 56609067.334op/s 56715176.103op/s 56773900.422op/s 56805943.795op/s 0.50% -0.267 -0.082 0.24% 9451.055op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 9.814µs 9.902µs ± 0.046µs 9.897µs ± 0.028µs 9.925µs 9.988µs 10.024µs 10.046µs 1.50% 0.634 0.313 0.47% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 99543240.900op/s 100996191.923op/s ± 470016.085op/s 101039784.227op/s ± 285039.029op/s 101325997.641op/s 101697083.708op/s 101851067.013op/s 101890179.498op/s 0.84% -0.608 0.271 0.46% 33235.156op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [187.124µs; 187.237µs] or [-0.030%; +0.030%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5340872.428op/s; 5344062.470op/s] or [-0.030%; +0.030%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.689µs; 17.701µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [56494701.827op/s; 56531749.280op/s] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/good execution_time [9.895µs; 9.908µs] or [-0.065%; +0.065%] None None None
normalization/normalize_name/normalize_name/good throughput [100931052.214op/s; 101061331.632op/s] or [-0.064%; +0.064%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.186µs 3.205µs ± 1.406µs 2.989µs ± 0.026µs 3.018µs 3.675µs 13.791µs 14.722µs 392.53% 7.311 54.794 43.76% 0.099µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.011µs; 3.400µs] or [-6.080%; +6.080%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2f92752 1759316611 bob/tracedata
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 48.406ms 48.779ms ± 1.364ms 48.603ms ± 0.071ms 48.706ms 48.820ms 53.061ms 64.355ms 32.41% 9.624 97.735 2.79% 0.096ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [48.590ms; 48.968ms] or [-0.388%; +0.388%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 95.65972% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.58%. Comparing base (0b59f64) to head (2f92752).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1247      +/-   ##
==========================================
- Coverage   71.66%   71.58%   -0.09%     
==========================================
  Files         355      357       +2     
  Lines       56312    56252      -60     
==========================================
- Hits        40358    40266      -92     
- Misses      15954    15986      +32     
Components Coverage Δ
datadog-crashtracker 49.33% <ø> (+0.04%) ⬆️
datadog-crashtracker-ffi 5.93% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.44% <94.11%> (-0.01%) ⬇️
data-pipeline-ffi 88.19% <ø> (ø)
ddcommon 84.29% <ø> (ø)
ddcommon-ffi 73.84% <ø> (ø)
ddtelemetry 59.98% <ø> (-0.04%) ⬇️
ddtelemetry-ffi 21.24% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.39% <ø> (-0.11%) ⬇️
datadog-profiling 76.90% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 36.71% <100.00%> (-0.48%) ⬇️
datdog-sidecar-ffi 9.61% <ø> (-2.26%) ⬇️
spawn-worker 55.35% <ø> (ø)
tinybytes 93.06% <ø> (+0.84%) ⬆️
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf 59.65% <ø> (ø)
datadog-trace-utils 89.60% <95.69%> (-0.17%) ⬇️
datadog-tracer-flare 54.52% <ø> (ø)
datadog-log 76.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dd-octo-sts
Copy link

dd-octo-sts bot commented Sep 29, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.19 MB 7.19 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 70.99 MB 70.98 MB --.02% (-15.34 KB) 💪
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.25 MB 9.25 MB -0% (-608 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 83.30 MB 83.29 MB -0% (-8.06 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 18.39 MB 18.39 MB --.04% (-8.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 65.77 KB 65.77 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 125.09 MB 124.78 MB --.24% (-320.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 654.42 MB 652.33 MB --.31% (-2.08 MB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 5.88 MB 5.87 MB --.07% (-4.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 65.77 KB 65.77 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 17.37 MB 17.37 MB --.04% (-8.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 32.21 MB 32.20 MB --.04% (-15.77 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 15.68 MB 15.67 MB --.05% (-9.00 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 66.79 KB 66.79 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 127.41 MB 127.05 MB --.27% (-360.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 644.54 MB 642.44 MB --.32% (-2.10 MB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.49 MB 4.49 MB --.03% (-1.50 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 66.79 KB 66.79 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 18.50 MB 18.49 MB --.04% (-8.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 30.25 MB 30.23 MB --.04% (-15.45 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 63.64 MB 63.63 MB --.02% (-16.38 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.51 MB 8.50 MB --.09% (-8.00 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 78.07 MB 78.06 MB --.01% (-11.28 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.85 MB 9.85 MB -0% (-392 B) 👌

}
/// TraceData implementation using `Bytes` and `BytesString`.
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TinyData;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about the name. If you have better suggestions, feel free.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think BytesData is better.

/// Trait representing a tuple of (Text, Bytes) types used for different underlying data structures.
/// Note: The functions are internal to the msgpack decoder and should not be used directly: they're
/// only exposed here due to the inavailability of min_specialization in stable Rust.
pub trait TraceData: Default + Debug + Clone + PartialEq + Serialize {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the Clone and PartialEq?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PartialEq is necessary because v04::Span is PartialEq. And yeah, generic types need to have all these derives of the context they are used in, otherwise #[derive] doesn't work.
I have no idea though why I added Clone. Removing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Clone is needed for some cases where we have to clone spans (e.g. benchmarks and some tests).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, would be nice to mark PartialEq and Clone as test convenience things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? Like by a comment? or a cfg_attr?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's a best practice for conditional trait requirements. You can of course make some other trait which is defined twice behind a #[cfg(test)] gates, one with and one without the extra requirements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's important enough to warrant conditional trait requirements. Was just an observation that it's only used from tests as far as I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, cfg_attr doesn't work anyway, that'd need at least a feature flag. That's ugly.

@bwoebi bwoebi force-pushed the bob/tracedata branch 2 times, most recently from 06bacc7 to 9bbe018 Compare September 30, 2025 13:40
Signed-off-by: Bob Weinand <[email protected]>
Copy link

datadog-official bot commented Sep 30, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2f92752 | Docs | Was this helpful? Give us feedback!

Signed-off-by: Bob Weinand <[email protected]>
Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the TraceData trait, it's a nice addition and makes even more sense with V1.

The span::Span was supposed to be a common interface for spans regardless of the encoding. It made sense with v04 and v05 as they have basically the same fields but since v1 has different fields (e.g. attributes vs meta/metrics) we probably won't be able to share a common representation. This also means we will have to reimplement all trace utils for v1 span.

Regarding the changes to the decoder I'm not a fan of having unsafe functions implemented on the SpanBytes. Also I think these changes should be addressed in a separate PR as they're not tied to the addition of TraceData.

state.serialize_field("array_value", &wrapped_value)?;
}
}
fn get_mut_slice(buf: &mut Self::Bytes) -> &mut &'static [u8];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like these functions should be implemented on the type of the buffer rather than on the TraceData type. Maybe in Buffer(B) B shouldn't be T::Bytes but a different type that implements a trait to be deserialized to Span<(T::Text,T::Bytes)>

Copy link
Contributor Author

@bwoebi bwoebi Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's mostly for convenience for now, so that Buffer -> T::Text works trivially. I wanted to not overcomplicate it, unless there's a real need for that. But it should not be overly problematic to change that in future if needed (e.g. you could then add a BufferData trait which holds (Out: TraceData, In: BufferInput) or such). Thanks to this already being T, it would be then a simple find T: TraceData & replace by a new T: BufferData operation at most places and returning T::Out::Text/Bytes then.

Comment on lines +64 to +66
/// `T` is the type used to represent strings in the span, it can be either owned (e.g. BytesString)
/// or borrowed (e.g. &str). To define a generic function taking any `Span<T>` you can use the
/// [`SpanValue`] trait:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc needs to be updated to match the change to TraceData


/// Internal Buffer used to wrap msgpack data for decoding.
/// Provides a couple accessors to extract data from the buffer.
pub struct Buffer<T: TraceData>(T::Bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use &[u8] for the buffer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to at least store the Bytes reference to construct the Bytes/BytesString object.

use zstd::stream::write::Encoder;

#[derive(Debug, Clone)]
#[derive(Debug)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to send_data are not linked to TraceData. Could you put them in a separate PR ?

Copy link
Contributor Author

@bwoebi bwoebi Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, because it relied on Clone on the Span, and TraceData is not meant to be Clone outside of testing. (but these changes are also relatively minor)

})
#[inline]
fn get_mut_slice<'b>(buf: &'b mut &'a [u8]) -> &'b mut &'static [u8] {
unsafe { std::mem::transmute::<&'b mut &[u8], &'b mut &'static [u8]>(buf) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unsafe and should at least be marked as such.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the generic variant on the trait probably should be.

@bwoebi
Copy link
Contributor Author

bwoebi commented Oct 1, 2025

This also means we will have to reimplement all trace utils for v1 span.

My plan is to have a projection with some functions which is compatible with all versions of the spans. Meaning that adding a float attribute will reroute to metrics, everything else to string.

That's why moving the span to v04 (and add a new span to v1), then we can add a common projection which routes accordingly, agnostic to the actual backend span used. I definitely want to avoid re-implementing everything.

@bwoebi
Copy link
Contributor Author

bwoebi commented Oct 1, 2025

Also I think these changes should be addressed in a separate PR as they're not tied to the addition of TraceData.

They sort of are, because the point of this PR is to also make use of TraceData, especially the meta_struct part making use of TraceData::Bytes.

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.

5 participants