Skip to content

feat(span): remove clone bound on spantext#1266

Merged
dd-mergequeue[bot] merged 7 commits intomainfrom
paullgdc/trace-utils/remove_clone_on_spantext
Nov 7, 2025
Merged

feat(span): remove clone bound on spantext#1266
dd-mergequeue[bot] merged 7 commits intomainfrom
paullgdc/trace-utils/remove_clone_on_spantext

Conversation

@paullegranddc
Copy link
Copy Markdown
Contributor

@paullegranddc paullegranddc commented Oct 15, 2025

Motivation

Cloning is very cheap as long as we have a ByteString or a str slice, but if we want to use python strings we need to hold the GIL to clone them.
This is not possible in general... But there are no operations requiring us to actual clone the data.

Changes

  • use an indexmap for the shared dictionary. This datastructure is exactly what we want (O(1) access and insertion order iteration) and keep only one of each value
  • Use indices into the span slice while computing top level rather than copying the service string

# Motivation

Cloning is very cheap as long as we have a ByteString or a str slice, but if we want to use python strings we need to hold the GIL to clone them.
This is not possible in general... But there are no operations requiring us to actual clone the data.

# Changes

* use an indexmap for the shared dictionary. This datastructure is exactly what we want (O(1) access and insertion order iteration) and keep only one of each value
*  Use indices into the span slice while computing top level rather than copying the service string
@paullegranddc paullegranddc requested review from a team as code owners October 15, 2025 17:35
@datadog-datadog-prod-us1
Copy link
Copy Markdown
Contributor

datadog-datadog-prod-us1 bot commented Oct 15, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 70351d5 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@paullegranddc paullegranddc changed the title feat(span): Remove clone bound on spantext feat(span): remove clone bound on spantext Oct 15, 2025
# Motivation

When we serialize we store the uppper 64 bits  of the trace id in a meta tag. But at runtime, we don't want to split it as the trace id still needs to be readable.
@paullegranddc paullegranddc force-pushed the paullgdc/trace-utils/remove_clone_on_spantext branch from e990211 to 2445a48 Compare October 15, 2025 17:37
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Oct 15, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-11-07 16:16:50

Comparing candidate commit 70351d5 in PR branch paullgdc/trace-utils/remove_clone_on_spantext with baseline commit a5f205d in branch main.

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

scenario:benching serializing traces from their internal representation to msgpack

  • 🟥 execution_time [+724.597µs; +737.170µs] or [+5.187%; +5.277%]

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟥 execution_time [+7.910µs; +7.953µs] or [+17.496%; +17.590%]
  • 🟥 throughput [-3311656.185op/s; -3291201.190op/s] or [-14.972%; -14.880%]

scenario:credit_card/is_card_number/x371413321323331

  • 🟥 execution_time [+399.779ns; +403.660ns] or [+6.622%; +6.686%]
  • 🟥 throughput [-10386978.805op/s; -10282970.535op/s] or [-6.271%; -6.208%]

scenario:credit_card/is_card_number_no_luhn/ 378282246310005

  • 🟥 execution_time [+5.752µs; +5.817µs] or [+10.846%; +10.968%]
  • 🟥 throughput [-1863496.312op/s; -1844695.600op/s] or [-9.883%; -9.783%]

scenario:credit_card/is_card_number_no_luhn/378282246310005

  • 🟥 execution_time [+5.814µs; +5.862µs] or [+11.670%; +11.767%]
  • 🟥 throughput [-2113166.156op/s; -2097493.112op/s] or [-10.528%; -10.449%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟥 execution_time [+7.890µs; +7.939µs] or [+17.463%; +17.572%]
  • 🟥 throughput [-3310665.507op/s; -3288454.597op/s] or [-14.957%; -14.857%]

scenario:credit_card/is_card_number_no_luhn/x371413321323331

  • 🟥 execution_time [+394.266ns; +399.317ns] or [+6.526%; +6.610%]
  • 🟥 throughput [-10272018.716op/s; -10135937.686op/s] or [-6.205%; -6.123%]

scenario:single_flag_killswitch/rules-based

  • 🟩 execution_time [-28.648ns; -25.019ns] or [-14.137%; -12.346%]

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 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 120.620µs 122.467µs ± 1.518µs 122.262µs ± 0.507µs 122.772µs 123.896µs 127.785µs 137.584µs 12.53% 5.943 50.880 1.24% 0.107µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [122.257µs; 122.677µs] or [-0.172%; +0.172%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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 204.918µs 205.524µs ± 0.413µs 205.424µs ± 0.231µs 205.710µs 206.407µs 206.904µs 207.195µs 0.86% 1.355 2.229 0.20% 0.029µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4826360.590op/s 4865633.495op/s ± 9757.123op/s 4867974.928op/s ± 5467.885op/s 4872398.633op/s 4877084.262op/s 4879676.946op/s 4880003.999op/s 0.25% -1.341 2.175 0.20% 689.933op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.580µs 18.679µs ± 0.086µs 18.652µs ± 0.040µs 18.717µs 18.853µs 18.977µs 19.039µs 2.08% 1.486 2.155 0.46% 0.006µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52522972.124op/s 53536219.653op/s ± 245039.603op/s 53613407.351op/s ± 115748.993op/s 53722349.923op/s 53776211.136op/s 53814852.091op/s 53822491.598op/s 0.39% -1.460 2.037 0.46% 17326.917op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.819µs 10.889µs ± 0.030µs 10.886µs ± 0.021µs 10.910µs 10.941µs 10.948µs 10.958µs 0.66% 0.099 -0.438 0.27% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 91254858.799op/s 91840271.465op/s ± 249032.324op/s 91861524.721op/s ± 176096.919op/s 92015447.358op/s 92242310.291op/s 92387352.127op/s 92434223.524op/s 0.62% -0.086 -0.436 0.27% 17609.245op/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 [205.467µs; 205.581µs] or [-0.028%; +0.028%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4864281.252op/s; 4866985.738op/s] or [-0.028%; +0.028%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.667µs; 18.691µs] or [-0.064%; +0.064%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53502259.521op/s; 53570179.786op/s] or [-0.063%; +0.063%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.884µs; 10.893µs] or [-0.038%; +0.038%] None None None
normalization/normalize_name/normalize_name/good throughput [91805757.980op/s; 91874784.950op/s] or [-0.038%; +0.038%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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 18.013µs 25.986µs ± 9.812µs 18.365µs ± 0.227µs 34.488µs 43.878µs 44.366µs 68.093µs 270.78% 0.917 0.283 37.66% 0.694µ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.626µs; 27.346µs] or [-5.233%; +5.233%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.179µs 3.174µs ± 1.428µs 3.002µs ± 0.024µs 3.020µs 3.360µs 13.794µs 15.152µs 404.82% 7.485 56.714 44.86% 0.101µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [2.976µs; 3.372µs] or [-6.233%; +6.233%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.360µs 2.408µs ± 0.012µs 2.408µs ± 0.004µs 2.415µs 2.423µs 2.434µs 2.452µs 1.83% -1.349 5.373 0.50% 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.407µs; 2.410µs] or [-0.069%; +0.069%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.363µs 34.809µs ± 0.731µs 34.466µs ± 0.053µs 34.625µs 36.302µs 36.356µs 38.454µs 11.57% 1.924 2.977 2.09% 0.052µ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.708µs; 34.910µs] or [-0.291%; +0.291%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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 60.356ms 60.824ms ± 1.521ms 60.603ms ± 0.035ms 60.638ms 60.962ms 69.011ms 75.034ms 23.81% 7.989 65.669 2.49% 0.108ms 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 [60.613ms; 61.035ms] or [-0.347%; +0.347%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.143ms 6.367ms ± 0.047ms 6.373ms ± 0.018ms 6.394ms 6.421ms 6.446ms 6.526ms 2.40% -1.573 4.534 0.74% 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.361ms; 6.374ms] or [-0.103%; +0.103%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 171.996ns 175.809ns ± 3.146ns 175.074ns ± 1.960ns 177.319ns 181.462ns 187.062ns 191.457ns 9.36% 1.632 4.186 1.79% 0.222ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [175.373ns; 176.245ns] or [-0.248%; +0.248%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.902µs 3.915µs ± 0.003µs 3.915µs ± 0.002µs 3.917µs 3.919µs 3.920µs 3.922µs 0.18% -0.264 1.695 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255001330.919op/s 255446638.893op/s ± 173497.536op/s 255459215.448op/s ± 119533.013op/s 255564040.176op/s 255698373.158op/s 255775568.452op/s 256281943.051op/s 0.32% 0.271 1.722 0.07% 12268.128op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 76.500µs 77.990µs ± 0.703µs 77.918µs ± 0.487µs 78.493µs 79.196µs 79.547µs 79.894µs 2.54% 0.226 -0.512 0.90% 0.050µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12516561.400op/s 12823208.687op/s ± 115342.198op/s 12834052.233op/s ± 80224.300op/s 12904918.066op/s 13007732.094op/s 13042767.881op/s 13071819.923op/s 1.85% -0.187 -0.533 0.90% 8155.925op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.707µs 71.999µs ± 0.717µs 71.942µs ± 0.498µs 72.447µs 73.174µs 73.762µs 74.129µs 3.04% 0.436 -0.196 0.99% 0.051µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13489997.167op/s 13890524.833op/s ± 137810.578op/s 13900012.017op/s ± 96301.364op/s 13995098.814op/s 14095259.391op/s 14134990.802op/s 14142915.895op/s 1.75% -0.389 -0.269 0.99% 9744.679op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.898µs 3.916µs ± 0.009µs 3.915µs ± 0.002µs 3.917µs 3.919µs 3.923µs 3.996µs 2.08% 8.378 76.817 0.22% 0.001µs 1 200
credit_card/is_card_number/37828224631 throughput 250251475.798op/s 255387885.095op/s ± 546099.274op/s 255445909.329op/s ± 117671.481op/s 255562107.983op/s 255660788.907op/s 255718548.579op/s 256566959.357op/s 0.44% -8.321 76.156 0.21% 38615.050op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.029µs 68.376µs ± 0.671µs 68.278µs ± 0.444µs 68.843µs 69.614µs 69.960µs 70.197µs 2.81% 0.521 -0.390 0.98% 0.047µs 1 200
credit_card/is_card_number/378282246310005 throughput 14245668.590op/s 14626417.473op/s ± 142899.762op/s 14645998.821op/s ± 95198.206op/s 14729058.965op/s 14831480.485op/s 14857701.382op/s 14918864.214op/s 1.86% -0.482 -0.436 0.97% 10104.539op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 53.063µs 53.142µs ± 0.041µs 53.140µs ± 0.026µs 53.166µs 53.204µs 53.265µs 53.377µs 0.45% 1.307 5.190 0.08% 0.003µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 18734625.712op/s 18817568.375op/s ± 14374.063op/s 18818171.065op/s ± 9221.428op/s 18827707.721op/s 18838364.169op/s 18842895.907op/s 18845673.577op/s 0.15% -1.294 5.115 0.08% 1016.400op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.429µs 6.439µs ± 0.005µs 6.438µs ± 0.004µs 6.442µs 6.447µs 6.450µs 6.462µs 0.37% 0.751 1.302 0.08% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 154750342.587op/s 155306787.965op/s ± 119872.081op/s 155324946.987op/s ± 85774.769op/s 155397929.340op/s 155474674.488op/s 155505677.772op/s 155541636.214op/s 0.14% -0.744 1.275 0.08% 8476.236op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.894µs 3.915µs ± 0.003µs 3.915µs ± 0.002µs 3.916µs 3.920µs 3.922µs 3.925µs 0.26% -0.798 9.062 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254781058.808op/s 255444414.072op/s ± 202935.093op/s 255454171.522op/s ± 106697.252op/s 255562440.306op/s 255712119.622op/s 255784360.334op/s 256782371.162op/s 0.52% 0.823 9.208 0.08% 14349.678op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.933µs 65.174µs ± 0.137µs 65.148µs ± 0.075µs 65.236µs 65.448µs 65.624µs 65.639µs 0.75% 1.116 1.299 0.21% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15234774.302op/s 15343497.725op/s ± 32072.409op/s 15349736.521op/s ± 17748.190op/s 15365725.605op/s 15383210.228op/s 15392242.987op/s 15400546.719op/s 0.33% -1.103 1.262 0.21% 2267.862op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.389µs 58.817µs ± 0.231µs 58.796µs ± 0.148µs 58.945µs 59.224µs 59.447µs 59.618µs 1.40% 0.722 0.476 0.39% 0.016µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16773594.243op/s 17002167.197op/s ± 66574.802op/s 17008070.595op/s ± 42982.180op/s 17050517.697op/s 17094724.995op/s 17113448.129op/s 17126398.631op/s 0.70% -0.700 0.422 0.39% 4707.549op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.915µs ± 0.003µs 3.915µs ± 0.002µs 3.917µs 3.920µs 3.923µs 3.924µs 0.24% -1.161 9.618 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254819343.163op/s 255404418.648op/s ± 204066.549op/s 255418964.871op/s ± 121985.534op/s 255532755.697op/s 255679506.282op/s 255736662.491op/s 256797182.108op/s 0.54% 1.186 9.795 0.08% 14429.684op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 55.388µs 55.657µs ± 0.169µs 55.625µs ± 0.110µs 55.745µs 55.989µs 56.168µs 56.249µs 1.12% 0.992 0.798 0.30% 0.012µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17778185.140op/s 17967365.863op/s ± 54466.304op/s 17977581.058op/s ± 35703.740op/s 18007486.175op/s 18036171.723op/s 18043247.741op/s 18054350.818op/s 0.43% -0.976 0.748 0.30% 3851.349op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.753µs 53.094µs ± 0.101µs 53.117µs ± 0.037µs 53.153µs 53.185µs 53.229µs 53.522µs 0.76% -0.892 2.262 0.19% 0.007µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 18683870.590op/s 18834663.524op/s ± 35722.820op/s 18826450.706op/s ± 13023.937op/s 18839424.187op/s 18905222.192op/s 18929856.555op/s 18956414.289op/s 0.69% 0.912 2.230 0.19% 2525.985op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.431µs 6.438µs ± 0.004µs 6.438µs ± 0.002µs 6.440µs 6.444µs 6.447µs 6.450µs 0.20% 0.507 0.278 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 155027802.185op/s 155331858.733op/s ± 86570.998op/s 155334888.216op/s ± 59421.177op/s 155394429.310op/s 155461827.212op/s 155491202.245op/s 155508038.654op/s 0.11% -0.504 0.271 0.06% 6121.494op/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.914µs; 3.915µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255422593.803op/s; 255470683.983op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [77.892µs; 78.087µs] or [-0.125%; +0.125%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12807223.367op/s; 12839194.006op/s] or [-0.125%; +0.125%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [71.899µs; 72.098µs] or [-0.138%; +0.138%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13871425.612op/s; 13909624.053op/s] or [-0.137%; +0.137%] None None None
credit_card/is_card_number/37828224631 execution_time [3.914µs; 3.917µs] or [-0.030%; +0.030%] None None None
credit_card/is_card_number/37828224631 throughput [255312200.987op/s; 255463569.202op/s] or [-0.030%; +0.030%] None None None
credit_card/is_card_number/378282246310005 execution_time [68.283µs; 68.469µs] or [-0.136%; +0.136%] None None None
credit_card/is_card_number/378282246310005 throughput [14606612.941op/s; 14646222.006op/s] or [-0.135%; +0.135%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [53.136µs; 53.147µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [18815576.268op/s; 18819560.482op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.438µs; 6.440µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/x371413321323331 throughput [155290174.848op/s; 155323401.083op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.914µs; 3.915µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ throughput [255416289.220op/s; 255472538.924op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.156µs; 65.193µs] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15339052.797op/s; 15347942.652op/s] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.785µs; 58.849µs] or [-0.054%; +0.054%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [16992940.570op/s; 17011393.824op/s] or [-0.054%; +0.054%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.915µs; 3.916µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255376136.987op/s; 255432700.309op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [55.634µs; 55.680µs] or [-0.042%; +0.042%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [17959817.357op/s; 17974914.369op/s] or [-0.042%; +0.042%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [53.080µs; 53.108µs] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [18829712.685op/s; 18839614.363op/s] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.437µs; 6.438µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155319860.825op/s; 155343856.641op/s] or [-0.008%; +0.008%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.566µs 536.317µs ± 1.395µs 535.865µs ± 0.672µs 537.063µs 538.871µs 539.826µs 545.942µs 1.88% 2.279 10.310 0.26% 0.099µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1831695.026op/s 1864580.098op/s ± 4820.949op/s 1866140.226op/s ± 2343.883op/s 1868119.448op/s 1869144.852op/s 1869986.648op/s 1870677.634op/s 0.24% -2.225 9.806 0.26% 340.893op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 380.364µs 381.043µs ± 0.296µs 381.021µs ± 0.170µs 381.225µs 381.586µs 381.691µs 382.053µs 0.27% 0.256 0.227 0.08% 0.021µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2617434.916op/s 2624377.497op/s ± 2036.235op/s 2624528.305op/s ± 1174.505op/s 2625531.513op/s 2627734.938op/s 2628519.345op/s 2629063.289op/s 0.17% -0.251 0.221 0.08% 143.984op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.624µs 190.083µs ± 0.218µs 190.072µs ± 0.137µs 190.211µs 190.447µs 190.687µs 190.905µs 0.44% 0.514 0.726 0.11% 0.015µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5238201.153op/s 5260872.055op/s ± 6038.439op/s 5261152.835op/s ± 3795.275op/s 5264867.378op/s 5270118.328op/s 5272752.732op/s 5273596.199op/s 0.24% -0.505 0.708 0.11% 426.982op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.766µs 37.892µs ± 0.050µs 37.888µs ± 0.036µs 37.928µs 37.976µs 38.017µs 38.043µs 0.41% 0.353 -0.095 0.13% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26285995.385op/s 26390755.051op/s ± 34612.071op/s 26393257.659op/s ± 24868.954op/s 26417497.252op/s 26442844.368op/s 26451098.698op/s 26478864.271op/s 0.32% -0.346 -0.103 0.13% 2447.443op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.762µs 45.891µs ± 0.050µs 45.892µs ± 0.026µs 45.915µs 45.958µs 46.024µs 46.222µs 0.72% 1.360 8.680 0.11% 0.004µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21634844.215op/s 21790765.518op/s ± 23884.084op/s 21790445.882op/s ± 12464.001op/s 21806941.331op/s 21826221.805op/s 21843145.871op/s 21852154.635op/s 0.28% -1.332 8.486 0.11% 1688.860op/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 [536.124µs; 536.511µs] or [-0.036%; +0.036%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1863911.961op/s; 1865248.235op/s] or [-0.036%; +0.036%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [381.002µs; 381.084µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2624095.294op/s; 2624659.699op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.053µs; 190.113µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5260035.186op/s; 5261708.925op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.885µs; 37.899µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26385958.151op/s; 26395551.951op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.884µs; 45.898µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21787455.414op/s; 21794075.623op/s] or [-0.015%; +0.015%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.637ms 10.668ms ± 0.015ms 10.666ms ± 0.008ms 10.675ms 10.688ms 10.719ms 10.765ms 0.93% 2.089 10.274 0.14% 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.666ms; 10.670ms] or [-0.019%; +0.019%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.853µs 87.069µs ± 0.233µs 87.052µs ± 0.053µs 87.105µs 87.193µs 87.285µs 90.101µs 3.50% 11.156 141.738 0.27% 0.016µ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 [87.037µs; 87.101µs] or [-0.037%; +0.037%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.627ms 14.701ms ± 0.034ms 14.695ms ± 0.016ms 14.713ms 14.763ms 14.821ms 14.869ms 1.18% 1.767 5.245 0.23% 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.696ms; 14.706ms] or [-0.032%; +0.032%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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.111µs 5.171µs ± 0.033µs 5.171µs ± 0.025µs 5.195µs 5.221µs 5.226µs 5.282µs 2.15% 0.069 -0.611 0.63% 0.002µ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.167µs; 5.176µs] or [-0.087%; +0.087%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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 242.822ns 254.234ns ± 12.988ns 248.000ns ± 2.393ns 254.602ns 285.941ns 293.385ns 305.459ns 23.17% 1.859 2.524 5.10% 0.918ns 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 [252.434ns; 256.034ns] or [-0.708%; +0.708%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 70351d5 1762531289 paullgdc/trace-utils/remove_clone_on_spantext
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 161.922µs 162.542µs ± 0.450µs 162.450µs ± 0.143µs 162.599µs 163.095µs 163.916µs 166.702µs 2.62% 5.206 39.799 0.28% 0.032µ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 [162.479µs; 162.604µs] or [-0.038%; +0.038%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 96.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.66%. Comparing base (a5f205d) to head (70351d5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1266      +/-   ##
==========================================
- Coverage   71.86%   71.66%   -0.20%     
==========================================
  Files         370      370              
  Lines       58499    58557      +58     
==========================================
- Hits        42042    41967      -75     
- Misses      16457    16590     +133     
Components Coverage Δ
datadog-crashtracker 50.65% <ø> (ø)
datadog-crashtracker-ffi 5.86% <ø> (ø)
datadog-alloc ∅ <ø> (∅)
data-pipeline 87.89% <ø> (ø)
data-pipeline-ffi 88.19% <ø> (ø)
ddcommon 80.97% <80.00%> (+0.01%) ⬆️
ddcommon-ffi 73.90% <80.00%> (+0.05%) ⬆️
ddtelemetry ∅ <ø> (∅)
ddtelemetry-ffi ∅ <ø> (∅)
dogstatsd-client ∅ <ø> (∅)
datadog-ipc 82.59% <ø> (ø)
datadog-profiling 75.92% <ø> (ø)
datadog-profiling-ffi 62.11% <ø> (ø)
datadog-sidecar 37.05% <0.00%> (-1.24%) ⬇️
datdog-sidecar-ffi 13.12% <0.00%> (-6.03%) ⬇️
spawn-worker 55.18% <ø> (ø)
tinybytes ∅ <ø> (∅)
datadog-trace-normalization ∅ <ø> (∅)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf ∅ <ø> (∅)
datadog-trace-utils 90.21% <100.00%> (-0.08%) ⬇️
datadog-tracer-flare 61.03% <ø> (-3.95%) ⬇️
datadog-log ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Oct 16, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.50 MB 7.50 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 82.75 MB 82.76 MB +.01% (+11.51 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.91 MB 95.94 MB +.03% (+32.16 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.54 MB 9.54 MB -0% (-24 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 18.86 MB 18.89 MB +.15% (+30.50 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 52.66 KB 52.66 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 131.02 MB 131.16 MB +.10% (+136.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 689.36 MB 690.41 MB +.15% (+1.05 MB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 6.24 MB 6.24 MB +.09% (+6.00 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 52.66 KB 52.66 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 18.86 MB 18.87 MB +.08% (+16.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 36.45 MB 36.47 MB +.06% (+22.66 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 15.96 MB 15.99 MB +.15% (+26.00 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 53.48 KB 53.48 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 133.20 MB 133.33 MB +.09% (+128.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 678.58 MB 679.45 MB +.12% (+896.83 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.79 MB 4.79 MB +.09% (+4.50 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 53.48 KB 53.48 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 20.01 MB 20.02 MB +.07% (+16.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 34.22 MB 34.25 MB +.07% (+25.17 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 71.73 MB 71.74 MB +.01% (+10.50 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.91 MB 8.91 MB +.04% (+4.00 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.70 MB 90.75 MB +.04% (+45.29 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.25 MB 10.25 MB +.03% (+3.89 KB) 🔍

@paullegranddc
Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex bot commented Nov 7, 2025

View all feedbacks in Devflow UI.

2025-11-07 16:13:58 UTC ℹ️ Start processing command /merge


2025-11-07 16:14:04 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.
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.


2025-11-07 16:33:31 UTC ℹ️ MergeQueue: merge request added to the queue

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


2025-11-07 17:06:08 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 4e2db8a into main Nov 7, 2025
37 checks passed
@dd-mergequeue dd-mergequeue bot deleted the paullgdc/trace-utils/remove_clone_on_spantext branch November 7, 2025 17:06
anais-raison pushed a commit that referenced this pull request Nov 10, 2025
feat(trace-utils): Remove clone bound on SpanText

# Motivation

Cloning is very cheap as long as we have a ByteString or a str slice, but if we want to use python strings we need to hold the GIL to clone them.
This is not possible in general... But there are no operations requiring us to actual clone the data.

# Changes

* use an indexmap for the shared dictionary. This datastructure is exactly what we want (O(1) access and insertion order iteration) and keep only one of each value
*  Use indices into the span slice while computing top level rather than copying the service string

fix: license 3rd party

feat(trace-utils): widen trace id to 128 bits

# Motivation

When we serialize we store the uppper 64 bits  of the trace id in a meta tag. But at runtime, we don't want to split it as the trace id still needs to be readable.

fix: skip high bits in 128bit trace id serialization

Merge branch 'main' into paullgdc/trace-utils/remove_clone_on_spantext

Merge branch 'main' into paullgdc/trace-utils/remove_clone_on_spantext

fix: 3rpaty + lints

Co-authored-by: paul.legranddescloizeaux <[email protected]>
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.

3 participants