Skip to content

feat(data-pipeline-ffi): add functions to manipulate span from C #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Leiyks
Copy link
Contributor

@Leiyks Leiyks commented Apr 2, 2025

What does this PR do?

This PR add functions to create and manipulate field of Rust Span struct from C code.

Motivation

The replacement of PHP Span to Rust Span in the PHP Tracer.

Additional Notes

As I am using macros to create the functions, the tests need to be run on a nightly version of Rust.

How to test the change?

Tests have been added, and this is linked to another one in the PHP tracer. (TODO)

@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch 5 times, most recently from 3172f33 to b6ff6bb Compare April 2, 2025 15:32
@pr-commenter
Copy link

pr-commenter bot commented Apr 2, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-07-11 14:11:23

Comparing candidate commit 5c4e725 in PR branch leiyks-add-span-conversion-functions with baseline commit 5754984 in branch main.

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

scenario:benching deserializing traces from msgpack to their internal representation

  • 🟩 execution_time [-13.379ms; -12.848ms] or [-18.373%; -17.643%]

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 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 205.580µs 206.165µs ± 0.213µs 206.167µs ± 0.145µs 206.300µs 206.527µs 206.672µs 206.777µs 0.30% 0.169 -0.133 0.10% 0.015µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4836132.234op/s 4850479.830op/s ± 5016.836op/s 4850433.603op/s ± 3400.561op/s 4854090.309op/s 4858398.497op/s 4860435.409op/s 4864285.770op/s 0.29% -0.163 -0.136 0.10% 354.744op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.246µs 18.355µs ± 0.113µs 18.308µs ± 0.026µs 18.366µs 18.576µs 18.769µs 18.953µs 3.52% 2.403 6.417 0.62% 0.008µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52761814.989op/s 54484523.954op/s ± 331867.387op/s 54620441.861op/s ± 78105.947op/s 54680620.948op/s 54729417.331op/s 54758587.882op/s 54806785.356op/s 0.34% -2.356 6.099 0.61% 23466.568op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.610µs 10.795µs ± 0.053µs 10.799µs ± 0.030µs 10.824µs 10.880µs 10.924µs 10.937µs 1.28% -0.259 1.482 0.49% 0.004µs 1 200
normalization/normalize_name/normalize_name/good throughput 91431028.201op/s 92641808.959op/s ± 458264.082op/s 92602475.981op/s ± 261495.089op/s 92903469.615op/s 93235922.546op/s 94134069.628op/s 94253826.274op/s 1.78% 0.309 1.554 0.49% 32404.164op/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 [206.136µs; 206.195µs] or [-0.014%; +0.014%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4849784.545op/s; 4851175.116op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.339µs; 18.370µs] or [-0.086%; +0.086%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [54438530.326op/s; 54530517.582op/s] or [-0.084%; +0.084%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.787µs; 10.802µs] or [-0.068%; +0.068%] None None None
normalization/normalize_name/normalize_name/good throughput [92578297.965op/s; 92705319.953op/s] or [-0.069%; +0.069%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.262µs 3.221µs ± 1.441µs 3.011µs ± 0.025µs 3.038µs 3.660µs 14.023µs 14.921µs 395.63% 7.410 55.769 44.62% 0.102µ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.021µs; 3.420µs] or [-6.200%; +6.200%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 59.322ms 59.705ms ± 1.911ms 59.468ms ± 0.053ms 59.528ms 59.697ms 68.558ms 81.494ms 37.04% 9.456 94.677 3.19% 0.135ms 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 [59.441ms; 59.970ms] or [-0.444%; +0.444%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.480µs 34.840µs ± 0.580µs 34.599µs ± 0.066µs 34.718µs 35.904µs 35.983µs 39.226µs 13.37% 3.101 15.405 1.66% 0.041µ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.759µs; 34.920µs] or [-0.231%; +0.231%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.607µs 24.968µs ± 9.457µs 18.011µs ± 0.328µs 33.772µs 42.698µs 50.752µs 68.069µs 277.93% 1.128 1.049 37.78% 0.669µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [23.658µs; 26.279µs] or [-5.249%; +5.249%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 245.304ns 255.919ns ± 13.925ns 249.181ns ± 3.141ns 262.467ns 285.357ns 300.228ns 301.889ns 21.15% 1.539 1.328 5.43% 0.985ns 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 [253.989ns; 257.849ns] or [-0.754%; +0.754%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.396µs 2.429µs ± 0.016µs 2.426µs ± 0.008µs 2.435µs 2.474µs 2.485µs 2.488µs 2.57% 1.600 3.376 0.67% 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.427µs; 2.431µs] or [-0.093%; +0.093%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.893µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.919µs 0.18% -0.766 5.670 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 255189756.947op/s 255629295.481op/s ± 198316.209op/s 255640109.934op/s ± 122483.775op/s 255763010.555op/s 255890406.187op/s 255929634.558op/s 256842191.575op/s 0.47% 0.782 5.773 0.08% 14023.074op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 80.093µs 81.239µs ± 0.571µs 81.191µs ± 0.424µs 81.642µs 82.270µs 82.586µs 82.692µs 1.85% 0.418 -0.439 0.70% 0.040µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12093063.497op/s 12309963.212op/s ± 86307.301op/s 12316617.942op/s ± 64540.577op/s 12376540.928op/s 12433330.962op/s 12474792.616op/s 12485415.918op/s 1.37% -0.389 -0.464 0.70% 6102.848op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 75.286µs 75.693µs ± 0.169µs 75.653µs ± 0.089µs 75.785µs 76.035µs 76.181µs 76.736µs 1.43% 1.867 7.464 0.22% 0.012µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13031616.465op/s 13211251.813op/s ± 29300.047op/s 13218330.545op/s ± 15589.188op/s 13229885.575op/s 13242628.893op/s 13263286.883op/s 13282622.345op/s 0.49% -1.827 7.195 0.22% 2071.826op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.890µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.915µs 3.918µs 3.918µs 0.16% -1.670 12.013 0.07% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255257001.474op/s 255665997.240op/s ± 189876.755op/s 255668795.637op/s ± 119983.940op/s 255787293.814op/s 255915938.041op/s 255981177.405op/s 257040026.772op/s 0.54% 1.695 12.225 0.07% 13426.314op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 72.467µs 72.840µs ± 0.108µs 72.829µs ± 0.054µs 72.898µs 73.043µs 73.109µs 73.152µs 0.44% 0.015 1.382 0.15% 0.008µs 1 200
credit_card/is_card_number/378282246310005 throughput 13670236.646op/s 13728695.325op/s ± 20349.433op/s 13730771.510op/s ± 10126.682op/s 13739913.298op/s 13755457.353op/s 13788856.953op/s 13799297.616op/s 0.50% -0.000 1.396 0.15% 1438.922op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.611µs 52.816µs ± 0.079µs 52.814µs ± 0.055µs 52.870µs 52.935µs 53.009µs 53.024µs 0.40% -0.006 -0.182 0.15% 0.006µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 18859496.749op/s 18933690.069op/s ± 28466.004op/s 18934465.921op/s ± 19572.538op/s 18952320.231op/s 18982231.781op/s 19002330.429op/s 19007538.390op/s 0.39% 0.015 -0.183 0.15% 2012.850op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.426µs 6.438µs ± 0.005µs 6.438µs ± 0.004µs 6.441µs 6.446µs 6.448µs 6.450µs 0.20% 0.047 -0.540 0.08% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 155029649.670op/s 155338337.736op/s ± 122289.429op/s 155336987.551op/s ± 85424.364op/s 155425598.596op/s 155530998.316op/s 155586979.144op/s 155607066.323op/s 0.17% -0.043 -0.541 0.08% 8647.168op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.896µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.921µs 3.925µs 0.30% -0.301 3.331 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254806952.593op/s 255564667.537op/s ± 216698.698op/s 255561600.622op/s ± 123275.625op/s 255691670.932op/s 255893691.059op/s 255938432.000op/s 256697810.057op/s 0.44% 0.314 3.375 0.08% 15322.912op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.911µs 65.109µs ± 0.098µs 65.089µs ± 0.057µs 65.158µs 65.274µs 65.423µs 65.638µs 0.84% 1.384 3.935 0.15% 0.007µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15235018.462op/s 15358927.677op/s ± 23130.611op/s 15363636.577op/s ± 13404.332op/s 15375412.795op/s 15387735.747op/s 15392880.116op/s 15405809.531op/s 0.27% -1.366 3.833 0.15% 1635.581op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.157µs 58.355µs ± 0.116µs 58.336µs ± 0.061µs 58.399µs 58.614µs 58.682µs 58.832µs 0.85% 1.358 2.361 0.20% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16997570.830op/s 17136425.799op/s ± 34101.877op/s 17141994.940op/s ± 17871.565op/s 17159636.246op/s 17179001.850op/s 17187273.134op/s 17194808.887op/s 0.31% -1.343 2.305 0.20% 2411.367op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.891µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.919µs 3.921µs 0.22% -1.289 8.962 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255022532.642op/s 255563355.272op/s ± 212963.846op/s 255573938.178op/s ± 136374.729op/s 255699974.431op/s 255853088.417op/s 255911278.181op/s 257003728.514op/s 0.56% 1.312 9.137 0.08% 15058.818op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 55.086µs 55.410µs ± 0.155µs 55.401µs ± 0.092µs 55.490µs 55.702µs 55.945µs 56.090µs 1.24% 1.131 2.433 0.28% 0.011µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17828419.683op/s 18047465.183op/s ± 50486.356op/s 18050303.003op/s ± 29933.317op/s 18080452.319op/s 18115311.806op/s 18135895.689op/s 18153336.317op/s 0.57% -1.105 2.339 0.28% 3569.924op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.628µs 52.823µs ± 0.077µs 52.828µs ± 0.054µs 52.875µs 52.948µs 52.990µs 53.011µs 0.35% -0.077 -0.276 0.14% 0.005µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 18864005.611op/s 18931167.558op/s ± 27430.299op/s 18929269.839op/s ± 19481.596op/s 18950723.383op/s 18980830.500op/s 18991967.842op/s 19001442.209op/s 0.38% 0.084 -0.275 0.14% 1939.615op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.427µs 6.436µs ± 0.005µs 6.436µs ± 0.003µs 6.439µs 6.444µs 6.449µs 6.453µs 0.26% 0.474 0.446 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 154963161.121op/s 155365053.857op/s ± 110878.277op/s 155364871.403op/s ± 76436.365op/s 155445197.797op/s 155527141.821op/s 155575739.583op/s 155603787.726op/s 0.15% -0.470 0.436 0.07% 7840.278op/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.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255601810.762op/s; 255656780.200op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [81.160µs; 81.318µs] or [-0.097%; +0.097%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12298001.851op/s; 12321924.574op/s] or [-0.097%; +0.097%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [75.670µs; 75.717µs] or [-0.031%; +0.031%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13207191.108op/s; 13215312.517op/s] or [-0.031%; +0.031%] 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 [255639682.148op/s; 255692312.332op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/378282246310005 execution_time [72.825µs; 72.855µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/378282246310005 throughput [13725875.090op/s; 13731515.561op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.805µs; 52.827µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [18929744.955op/s; 18937635.184op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.437µs; 6.438µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/x371413321323331 throughput [155321389.597op/s; 155355285.875op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.913µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ throughput [255534635.181op/s; 255594699.892op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.095µs; 65.122µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15355721.996op/s; 15362133.357op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.339µs; 58.372µs] or [-0.028%; +0.028%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17131699.607op/s; 17141151.991op/s] or [-0.028%; +0.028%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255533840.531op/s; 255592870.013op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [55.388µs; 55.431µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18040468.259op/s; 18054462.106op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.812µs; 52.834µs] or [-0.020%; +0.020%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [18927365.983op/s; 18934969.134op/s] or [-0.020%; +0.020%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.436µs; 6.437µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155349687.194op/s; 155380420.520op/s] or [-0.010%; +0.010%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 8.245ms 8.269ms ± 0.011ms 8.267ms ± 0.006ms 8.273ms 8.286ms 8.311ms 8.318ms 0.62% 1.408 3.935 0.13% 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 [8.267ms; 8.270ms] or [-0.018%; +0.018%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.173µs 535.651µs ± 0.604µs 535.584µs ± 0.340µs 535.937µs 536.543µs 537.293µs 540.326µs 0.89% 2.551 16.873 0.11% 0.043µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1850735.564op/s 1866888.843op/s ± 2100.431op/s 1867119.930op/s ± 1183.306op/s 1868261.928op/s 1869483.536op/s 1870073.025op/s 1872054.130op/s 0.26% -2.510 16.478 0.11% 148.523op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 382.408µs 383.066µs ± 0.299µs 383.045µs ± 0.190µs 383.243µs 383.612µs 383.828µs 383.981µs 0.24% 0.396 0.046 0.08% 0.021µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2604297.589op/s 2610516.211op/s ± 2034.436op/s 2610657.248op/s ± 1294.110op/s 2611878.392op/s 2613534.451op/s 2614594.973op/s 2615008.946op/s 0.17% -0.391 0.041 0.08% 143.856op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 195.542µs 196.572µs ± 0.366µs 196.715µs ± 0.122µs 196.810µs 196.921µs 197.008µs 197.272µs 0.28% -1.190 0.172 0.19% 0.026µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5069144.464op/s 5087201.625op/s ± 9490.679op/s 5083502.889op/s ± 3157.828op/s 5087782.492op/s 5106463.037op/s 5109348.214op/s 5113981.909op/s 0.60% 1.194 0.180 0.19% 671.092op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 38.033µs 38.154µs ± 0.050µs 38.150µs ± 0.037µs 38.191µs 38.236µs 38.269µs 38.304µs 0.40% 0.285 -0.346 0.13% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26107222.050op/s 26209857.605op/s ± 34394.605op/s 26212227.771op/s ± 25556.959op/s 26235757.878op/s 26266068.678op/s 26275521.749op/s 26293128.948op/s 0.31% -0.279 -0.351 0.13% 2432.066op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.896µs 46.644µs ± 0.532µs 46.988µs ± 0.156µs 47.076µs 47.161µs 47.217µs 48.472µs 3.16% -0.167 -1.197 1.14% 0.038µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20630377.222op/s 21441903.719op/s ± 244993.982op/s 21281883.523op/s ± 70214.039op/s 21721915.568op/s 21766709.751op/s 21780696.755op/s 21788449.168op/s 2.38% 0.192 -1.284 1.14% 17323.691op/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 [535.567µs; 535.735µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1866597.743op/s; 1867179.942op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [383.025µs; 383.108µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2610234.258op/s; 2610798.164op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [196.522µs; 196.623µs] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5085886.308op/s; 5088516.941op/s] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [38.147µs; 38.161µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26205090.843op/s; 26214624.366op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [46.570µs; 46.717µs] or [-0.158%; +0.158%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21407949.910op/s; 21475857.529op/s] or [-0.158%; +0.158%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.832ms 14.892ms ± 0.033ms 14.887ms ± 0.015ms 14.902ms 14.950ms 15.009ms 15.040ms 1.03% 1.800 5.118 0.22% 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.887ms; 14.896ms] or [-0.030%; +0.030%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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.404µs 86.881µs ± 1.576µs 86.691µs ± 0.077µs 86.761µs 86.888µs 95.255µs 104.372µs 20.40% 8.921 85.567 1.81% 0.111µ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.663µs; 87.100µs] or [-0.251%; +0.251%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 149.940µs 151.258µs ± 0.357µs 151.250µs ± 0.148µs 151.394µs 151.586µs 152.195µs 154.356µs 2.05% 3.045 29.087 0.24% 0.025µ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 [151.209µs; 151.308µs] or [-0.033%; +0.033%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 5c4e725 1752242391 leiyks-add-span-conversion-functions
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 4.996µs 5.070µs ± 0.035µs 5.077µs ± 0.025µs 5.097µs 5.113µs 5.124µs 5.125µs 0.95% -0.484 -1.067 0.68% 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.065µs; 5.075µs] or [-0.095%; +0.095%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 52.09497% with 343 lines in your changes missing coverage. Please review.

Project coverage is 71.00%. Comparing base (d5122a4) to head (5c4e725).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #994      +/-   ##
==========================================
- Coverage   71.42%   71.00%   -0.43%     
==========================================
  Files         342      346       +4     
  Lines       52062    53048     +986     
==========================================
+ Hits        37186    37667     +481     
- Misses      14876    15381     +505     
Components Coverage Δ
datadog-crashtracker 43.81% <ø> (-0.11%) ⬇️
datadog-crashtracker-ffi 5.93% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 89.22% <100.00%> (+0.01%) ⬆️
data-pipeline-ffi 87.61% <ø> (+0.22%) ⬆️
ddcommon 82.99% <100.00%> (+0.10%) ⬆️
ddcommon-ffi 70.01% <100.00%> (+0.35%) ⬆️
ddtelemetry 60.08% <ø> (ø)
ddtelemetry-ffi 21.32% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.58% <ø> (ø)
datadog-profiling 77.13% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 39.31% <24.00%> (-2.28%) ⬇️
datdog-sidecar-ffi 12.34% <24.00%> (+6.46%) ⬆️
spawn-worker 55.35% <ø> (ø)
tinybytes 91.59% <ø> (+0.63%) ⬆️
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf 77.10% <ø> (ø)
datadog-trace-utils 89.17% <93.99%> (+0.08%) ⬆️
datadog-tracer-flare 78.54% <ø> (ø)
datadog-log 76.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch 4 times, most recently from c78046e to 00df87d Compare April 4, 2025 14:59
@r1viollet
Copy link
Contributor

r1viollet commented Apr 4, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 9.17 MB 9.17 MB --.06% (-5.99 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 70.15 MB 70.01 MB --.19% (-140.20 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 22.07 MB 22.00 MB --.31% (-72.28 KB) 💪
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.09 MB 9.09 MB --.06% (-5.79 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 82.34 MB 82.16 MB --.21% (-185.04 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 26.11 MB 26.03 MB --.32% (-87.86 KB) 💪
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 18.35 MB 18.25 MB --.49% (-93.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 64.26 KB 64.26 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 124.44 MB 123.95 MB --.38% (-496.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 643.10 MB 641.89 MB --.18% (-1.21 MB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 5.86 MB 5.84 MB --.22% (-13.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 64.26 KB 64.26 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 17.30 MB 17.27 MB --.18% (-32.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 32.09 MB 32.02 MB --.19% (-65.25 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 15.64 MB 15.55 MB --.55% (-89.50 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 65.25 KB 65.25 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 126.75 MB 126.23 MB --.41% (-536.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 632.73 MB 631.51 MB --.19% (-1.22 MB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.47 MB 4.46 MB --.22% (-10.50 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 65.25 KB 65.25 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 18.44 MB 18.40 MB --.21% (-40.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 30.13 MB 30.07 MB --.21% (-66.68 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 62.88 MB 62.74 MB --.20% (-133.50 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.83 MB 9.81 MB --.20% (-21.11 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 20.91 MB 20.84 MB --.32% (-70.19 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 77.33 MB 77.16 MB --.21% (-173.33 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.73 MB 9.71 MB --.21% (-20.97 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 24.05 MB 23.96 MB --.33% (-83.62 KB) 💪

@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch 2 times, most recently from cee1bc0 to a9c6aa1 Compare April 7, 2025 14:51
@Leiyks Leiyks marked this pull request as ready for review April 7, 2025 15:17
@Leiyks Leiyks requested a review from a team as a code owner April 7, 2025 15:17
ekump
ekump previously requested changes Apr 7, 2025
Copy link
Contributor

@ekump ekump left a comment

Choose a reason for hiding this comment

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

The Data Pipeline team hasn't seen any design docs or had any conversations about adding this functionality. Also, I'm not ok with tests that can only run on nightly. Our CI is on stable, and we build our releases with stable.

@Leiyks Leiyks marked this pull request as draft April 8, 2025 10:49
@Leiyks
Copy link
Contributor Author

Leiyks commented Apr 8, 2025

The Data Pipeline team hasn't seen any design docs or had any conversations about adding this functionality. Also, I'm not ok with tests that can only run on nightly. Our CI is on stable, and we build our releases with stable.

It's an error on my part, the PR was supposed to stay in draft as it is just at the experiment level yet.
Sorry for the inconvenience 🙇

@ekump ekump dismissed their stale review April 8, 2025 12:11

PR wasn't ready for review yet, and was moved to draft.

@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch 3 times, most recently from 62862df to d7d9779 Compare April 18, 2025 15:51
@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch 2 times, most recently from 0e074ee to ac9484b Compare April 23, 2025 15:52
@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch from 0a39708 to a03994a Compare April 30, 2025 13:10
@Leiyks Leiyks force-pushed the leiyks-add-span-conversion-functions branch from abe97d7 to ed40e83 Compare June 20, 2025 12:18
Leiyks and others added 18 commits July 7, 2025 12:45
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
…fety

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the leiyks-add-span-conversion-functions branch from ed40e83 to 6779847 Compare July 8, 2025 15:02
@bwoebi bwoebi marked this pull request as ready for review July 8, 2025 15:03
@bwoebi bwoebi requested review from a team as code owners July 8, 2025 15:03
write_str(writer, "span_links")?;
rmp::encode::write_array_len(writer, span.span_links.len() as u32)?;
for link in span.span_links.iter() {
let mut link_len = 3; /* minimal span link: trace_id, trace_id_high, span_id */
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you extract writing a span link and a span event to their functions?

Comment on lines +14 to +19
// If it's the first span make it the root
let span_id = if i == 0 {
root_span_id
} else {
root_span_id + i as u64 + 1
};
Copy link
Contributor

Choose a reason for hiding this comment

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

if i == 0 the root_span_id + i as u64 is root_span_id, otherwise it's a new value?

Suggested change
// If it's the first span make it the root
let span_id = if i == 0 {
root_span_id
} else {
root_span_id + i as u64 + 1
};
// If it's the first span make it the root
let span_id = root_span_id + i as u64;

Comment on lines +133 to +139
/// # Safety
/// Callers must ensure this is only used for read or drop purposes
/// that are compatible with how the memory was originally allocated.
pub const fn as_raw_parts(&self) -> (*const T, usize) {
(self.ptr, self.len)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used in this PR?

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.

7 participants