Skip to content
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

Add generic Span #884

Merged
merged 6 commits into from
Feb 21, 2025
Merged

Add generic Span #884

merged 6 commits into from
Feb 21, 2025

Conversation

VianneyRuhlmann
Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann commented Feb 18, 2025

What does this PR do?

Add a span with a generic string type to be used to support BytesStrings and &str.

Motivation

Supporting slice based spans is required to support borrowed payload.

Additional Notes

The functions in trace-utils/src/span/v04/trace_utils.rs have been modified to use a generic span to show how to use the new type.
Many files have been changed for renaming but most changes are in trace-utils/src/span/v04.
`

How to test the change?

Describe here in detail how the change can be validated.

@pr-commenter
Copy link

pr-commenter bot commented Feb 18, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-02-21 12:23:29

Comparing candidate commit 4be708f in PR branch vianney/add-generic-span with baseline commit 1f16a44 in branch main.

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

scenario:benching deserializing traces from msgpack to their internal representation

  • 🟩 execution_time [-3.107ms; -3.035ms] or [-5.461%; -5.334%]

scenario:credit_card/is_card_number/378282246310005

  • 🟩 execution_time [-9.469µs; -9.227µs] or [-11.055%; -10.771%]
  • 🟩 throughput [+1411957.342op/s; +1446810.601op/s] or [+12.094%; +12.393%]

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 4be708f 1740139767 vianney/add-generic-span
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 6.011ms 6.022ms ± 0.008ms 6.021ms ± 0.003ms 6.024ms 6.030ms 6.062ms 6.080ms 0.98% 4.054 22.399 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 [6.021ms; 6.023ms] or [-0.019%; +0.019%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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.894µs 3.913µs ± 0.003µs 3.913µs ± 0.001µs 3.915µs 3.917µs 3.919µs 3.920µs 0.17% -1.847 12.615 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255095599.471op/s 255535184.822op/s ± 172062.248op/s 255527519.621op/s ± 76179.527op/s 255599201.253op/s 255825236.214op/s 255891407.043op/s 256779748.878op/s 0.49% 1.869 12.797 0.07% 12166.638op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 80.935µs 82.717µs ± 0.676µs 82.759µs ± 0.470µs 83.190µs 83.776µs 83.984µs 84.827µs 2.50% -0.066 -0.365 0.81% 0.048µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11788697.056op/s 12090286.885op/s ± 98831.634op/s 12083295.460op/s ± 68685.360op/s 12158664.083op/s 12258485.829op/s 12293701.041op/s 12355554.884op/s 2.25% 0.106 -0.379 0.82% 6988.452op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 77.716µs 79.553µs ± 0.425µs 79.569µs ± 0.272µs 79.863µs 80.160µs 80.380µs 80.456µs 1.11% -0.575 0.913 0.53% 0.030µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 12429195.181op/s 12570610.076op/s ± 67429.288op/s 12567660.657op/s ± 42963.045op/s 12605556.665op/s 12688826.129op/s 12734676.956op/s 12867294.125op/s 2.38% 0.617 1.048 0.54% 4767.971op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.895µs 3.914µs ± 0.002µs 3.914µs ± 0.001µs 3.915µs 3.916µs 3.919µs 3.919µs 0.14% -2.864 22.641 0.06% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255161785.150op/s 255522599.518op/s ± 149027.374op/s 255521337.756op/s ± 68860.360op/s 255580850.605op/s 255746059.132op/s 255839441.840op/s 256761976.324op/s 0.49% 2.893 22.928 0.06% 10537.827op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 75.222µs 76.313µs ± 0.386µs 76.339µs ± 0.278µs 76.607µs 76.853µs 77.064µs 77.352µs 1.33% -0.326 -0.174 0.50% 0.027µs 1 200
credit_card/is_card_number/378282246310005 throughput 12927949.404op/s 13104267.110op/s ± 66382.598op/s 13099433.123op/s ± 47729.564op/s 13147376.321op/s 13224019.978op/s 13260684.478op/s 13294048.748op/s 1.49% 0.352 -0.154 0.51% 4693.959op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.360µs 51.434µs ± 0.025µs 51.433µs ± 0.012µs 51.446µs 51.472µs 51.492µs 51.544µs 0.21% 0.182 2.133 0.05% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19401079.715op/s 19442520.336op/s ± 9271.716op/s 19442670.371op/s ± 4530.479op/s 19447132.969op/s 19457799.050op/s 19468049.388op/s 19470533.295op/s 0.14% -0.176 2.123 0.05% 655.609op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.028µs 6.038µs ± 0.006µs 6.038µs ± 0.002µs 6.039µs 6.044µs 6.049µs 6.109µs 1.18% 8.698 100.709 0.10% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163700048.131op/s 165609989.201op/s ± 160225.049op/s 165627187.705op/s ± 42004.033op/s 165664924.088op/s 165739926.762op/s 165788298.913op/s 165892568.133op/s 0.16% -8.619 99.439 0.10% 11329.622op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.888µs 3.913µs ± 0.003µs 3.913µs ± 0.001µs 3.914µs 3.918µs 3.922µs 3.924µs 0.28% -2.077 21.854 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254828125.608op/s 255539759.794op/s ± 199630.158op/s 255536971.807op/s ± 80193.649op/s 255623881.661op/s 255803069.269op/s 255899491.486op/s 257169298.493op/s 0.64% 2.123 22.228 0.08% 14115.984op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.894µs 66.213µs ± 0.185µs 66.176µs ± 0.111µs 66.309µs 66.561µs 66.749µs 66.931µs 1.14% 1.024 1.287 0.28% 0.013µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 14940722.929op/s 15102948.970op/s ± 42011.803op/s 15111317.622op/s ± 25393.543op/s 15132442.823op/s 15158537.649op/s 15174136.935op/s 15175995.314op/s 0.43% -1.006 1.228 0.28% 2970.683op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 59.398µs 59.667µs ± 0.088µs 59.670µs ± 0.059µs 59.728µs 59.800µs 59.850µs 59.882µs 0.36% -0.229 -0.178 0.15% 0.006µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16699512.354op/s 16759602.719op/s ± 24857.703op/s 16758854.510op/s ± 16436.707op/s 16775571.416op/s 16798345.791op/s 16820888.819op/s 16835516.205op/s 0.46% 0.237 -0.173 0.15% 1757.705op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.900µs 3.913µs ± 0.003µs 3.913µs ± 0.001µs 3.915µs 3.917µs 3.922µs 3.926µs 0.33% 0.215 5.458 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254693309.880op/s 255536981.795op/s ± 180217.128op/s 255538432.981op/s ± 81797.607op/s 255616465.252op/s 255823417.082op/s 255900153.117op/s 256438230.554op/s 0.35% -0.199 5.462 0.07% 12743.275op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 56.267µs 56.746µs ± 0.177µs 56.748µs ± 0.123µs 56.865µs 57.018µs 57.144µs 57.160µs 0.73% -0.071 -0.203 0.31% 0.013µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17494882.994op/s 17622661.129op/s ± 55036.946op/s 17621912.026op/s ± 38063.210op/s 17660002.746op/s 17708118.824op/s 17761450.258op/s 17772287.000op/s 0.85% 0.087 -0.196 0.31% 3891.700op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.356µs 51.433µs ± 0.031µs 51.427µs ± 0.011µs 51.445µs 51.487µs 51.560µs 51.574µs 0.29% 1.486 4.813 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19389524.307op/s 19442681.870op/s ± 11893.234op/s 19444876.691op/s ± 4337.524op/s 19448313.675op/s 19459861.118op/s 19466229.170op/s 19471791.216op/s 0.14% -1.478 4.781 0.06% 840.979op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.030µs 6.039µs ± 0.006µs 6.038µs ± 0.001µs 6.040µs 6.044µs 6.051µs 6.108µs 1.16% 8.110 86.797 0.10% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163719663.324op/s 165600568.244op/s ± 164577.007op/s 165625543.037op/s ± 39640.940op/s 165658506.686op/s 165719712.365op/s 165804395.920op/s 165824816.339op/s 0.12% -8.041 85.694 0.10% 11637.352op/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.913µs; 3.914µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255511338.649op/s; 255559030.995op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [82.623µs; 82.810µs] or [-0.113%; +0.113%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12076589.771op/s; 12103983.999op/s] or [-0.113%; +0.113%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [79.494µs; 79.612µs] or [-0.074%; +0.074%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12561265.025op/s; 12579955.127op/s] or [-0.074%; +0.074%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.914µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/37828224631 throughput [255501945.758op/s; 255543253.279op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/378282246310005 execution_time [76.259µs; 76.366µs] or [-0.070%; +0.070%] None None None
credit_card/is_card_number/378282246310005 throughput [13095067.120op/s; 13113467.100op/s] or [-0.070%; +0.070%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [51.430µs; 51.437µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19441235.366op/s; 19443805.307op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.037µs; 6.039µs] or [-0.014%; +0.014%] None None None
credit_card/is_card_number/x371413321323331 throughput [165587783.551op/s; 165632194.852op/s] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ throughput [255512092.974op/s; 255567426.614op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [66.187µs; 66.238µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15097126.538op/s; 15108771.401op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [59.655µs; 59.680µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [16756157.680op/s; 16763047.757op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.913µs; 3.914µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255512005.434op/s; 255561958.155op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [56.721µs; 56.770µs] or [-0.043%; +0.043%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [17615033.537op/s; 17630288.720op/s] or [-0.043%; +0.043%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [51.429µs; 51.438µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19441033.583op/s; 19444330.158op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.038µs; 6.039µs] or [-0.014%; +0.014%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165577759.454op/s; 165623377.035op/s] or [-0.014%; +0.014%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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.171µs 3.145µs ± 1.487µs 2.951µs ± 0.029µs 2.975µs 3.581µs 13.743µs 16.535µs 460.38% 7.599 59.032 47.16% 0.105µ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.939µs; 3.351µs] or [-6.552%; +6.552%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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.953µs 25.975µs ± 11.236µs 18.258µs ± 0.068µs 34.959µs 44.958µs 55.004µs 99.030µs 442.40% 2.287 9.878 43.15% 0.795µ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.418µs; 27.532µs] or [-5.995%; +5.995%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 53.499ms 53.831ms ± 0.166ms 53.841ms ± 0.082ms 53.910ms 54.087ms 54.417ms 54.577ms 1.37% 0.703 2.538 0.31% 0.012ms 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 [53.808ms; 53.854ms] or [-0.043%; +0.043%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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.316µs 2.383µs ± 0.018µs 2.382µs ± 0.007µs 2.393µs 2.413µs 2.421µs 2.426µs 1.81% -1.064 3.192 0.76% 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.381µs; 2.386µs] or [-0.105%; +0.105%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 150.178µs 151.088µs ± 1.178µs 150.972µs ± 0.168µs 151.153µs 151.562µs 151.796µs 167.089µs 10.67% 12.621 168.762 0.78% 0.083µ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 [150.925µs; 151.251µs] or [-0.108%; +0.108%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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.991µs 5.074µs ± 0.046µs 5.075µs ± 0.043µs 5.106µs 5.143µs 5.150µs 5.153µs 1.54% -0.047 -1.237 0.90% 0.003µ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.068µs; 5.081µs] or [-0.125%; +0.125%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 65.086µs 65.314µs ± 0.254µs 65.258µs ± 0.057µs 65.349µs 65.539µs 65.922µs 68.316µs 4.68% 8.631 96.244 0.39% 0.018µ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 [65.279µs; 65.349µs] or [-0.054%; +0.054%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 244.544ns 253.088ns ± 11.382ns 247.508ns ± 1.838ns 251.829ns 277.933ns 289.256ns 293.603ns 18.62% 1.851 2.419 4.49% 0.805ns 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 [251.510ns; 254.665ns] or [-0.623%; +0.623%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 504.840µs 505.841µs ± 0.784µs 505.776µs ± 0.262µs 506.046µs 506.540µs 507.068µs 515.281µs 1.88% 8.826 103.370 0.15% 0.055µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1940689.719op/s 1976909.553op/s ± 3023.252op/s 1977158.547op/s ± 1022.578op/s 1978134.416op/s 1979321.087op/s 1980158.273op/s 1980827.134op/s 0.19% -8.699 101.321 0.15% 213.776op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 452.741µs 453.685µs ± 0.976µs 453.575µs ± 0.174µs 453.757µs 454.098µs 454.605µs 463.314µs 2.15% 8.608 79.409 0.21% 0.069µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2158364.840op/s 2204180.870op/s ± 4656.843op/s 2204708.386op/s ± 845.201op/s 2205480.299op/s 2206673.291op/s 2207543.637op/s 2208766.905op/s 0.18% -8.561 78.806 0.21% 329.289op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 175.701µs 176.756µs ± 0.300µs 176.802µs ± 0.164µs 176.958µs 177.164µs 177.292µs 177.416µs 0.35% -0.696 0.403 0.17% 0.021µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5636484.940op/s 5657529.316op/s ± 9601.305op/s 5656055.148op/s ± 5247.107op/s 5662215.429op/s 5674469.996op/s 5682244.366op/s 5691474.601op/s 0.63% 0.706 0.422 0.17% 678.915op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.555µs 37.671µs ± 0.046µs 37.671µs ± 0.030µs 37.698µs 37.738µs 37.830µs 37.860µs 0.50% 0.704 1.820 0.12% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26412772.357op/s 26545561.071op/s ± 32162.336op/s 26545575.628op/s ± 21136.143op/s 26568101.084op/s 26592065.616op/s 26604251.023op/s 26627777.726op/s 0.31% -0.692 1.784 0.12% 2274.221op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 48.236µs 48.331µs ± 0.155µs 48.311µs ± 0.024µs 48.339µs 48.390µs 48.449µs 49.962µs 3.42% 9.095 87.010 0.32% 0.011µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20015184.247op/s 20691005.019op/s ± 64370.316op/s 20699239.117op/s ± 10080.795op/s 20707179.597op/s 20721768.150op/s 20726402.516op/s 20731423.467op/s 0.16% -9.035 86.124 0.31% 4551.669op/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 [505.733µs; 505.950µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1976490.560op/s; 1977328.547op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [453.550µs; 453.821µs] or [-0.030%; +0.030%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2203535.476op/s; 2204826.263op/s] or [-0.029%; +0.029%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [176.715µs; 176.798µs] or [-0.023%; +0.023%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5656198.667op/s; 5658859.964op/s] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.665µs; 37.677µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26541103.681op/s; 26550018.462op/s] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [48.309µs; 48.352µs] or [-0.044%; +0.044%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [20682083.912op/s; 20699926.126op/s] or [-0.043%; +0.043%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 33.004µs 33.765µs ± 1.256µs 33.195µs ± 0.053µs 33.281µs 36.437µs 36.543µs 38.224µs 15.15% 1.750 1.248 3.71% 0.089µ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 [33.591µs; 33.939µs] or [-0.516%; +0.516%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4be708f 1740139767 vianney/add-generic-span
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 208.560µs 209.015µs ± 0.142µs 209.009µs ± 0.089µs 209.104µs 209.214µs 209.355µs 209.419µs 0.20% -0.271 0.729 0.07% 0.010µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4775126.050op/s 4784346.088op/s ± 3242.970op/s 4784476.924op/s ± 2047.183op/s 4786280.925op/s 4789810.477op/s 4793554.492op/s 4794780.083op/s 0.22% 0.276 0.734 0.07% 229.313op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.221µs 18.306µs ± 0.066µs 18.298µs ± 0.016µs 18.322µs 18.359µs 18.378µs 19.125µs 4.52% 9.756 119.537 0.36% 0.005µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52287283.030op/s 54628276.077op/s ± 189455.605op/s 54649438.777op/s ± 49241.038op/s 54682461.485op/s 54775302.975op/s 54866516.636op/s 54882894.201op/s 0.43% -9.473 114.911 0.35% 13396.534op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.637µs 10.703µs ± 0.025µs 10.698µs ± 0.016µs 10.720µs 10.746µs 10.765µs 10.781µs 0.78% 0.494 0.224 0.24% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 92752928.317op/s 93435619.423op/s ± 221151.524op/s 93472122.705op/s ± 139193.033op/s 93585101.261op/s 93740354.519op/s 93870983.757op/s 94013373.041op/s 0.58% -0.480 0.210 0.24% 15637.774op/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 [208.995µs; 209.035µs] or [-0.009%; +0.009%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4783896.644op/s; 4784795.532op/s] or [-0.009%; +0.009%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.297µs; 18.315µs] or [-0.050%; +0.050%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [54602019.352op/s; 54654532.802op/s] or [-0.048%; +0.048%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.699µs; 10.706µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/good throughput [93404969.949op/s; 93466268.897op/s] or [-0.033%; +0.033%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 97.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 71.79%. Comparing base (1f16a44) to head (4be708f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #884      +/-   ##
==========================================
+ Coverage   71.77%   71.79%   +0.01%     
==========================================
  Files         328      328              
  Lines       48577    48600      +23     
==========================================
+ Hits        34866    34892      +26     
+ Misses      13711    13708       -3     
Components Coverage Δ
crashtracker 42.93% <ø> (+0.05%) ⬆️
crashtracker-ffi 6.25% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 92.07% <100.00%> (+<0.01%) ⬆️
data-pipeline-ffi 90.39% <100.00%> (ø)
ddcommon 80.08% <ø> (ø)
ddcommon-ffi 61.05% <ø> (ø)
ddtelemetry 61.74% <ø> (ø)
ddtelemetry-ffi 22.46% <ø> (ø)
dogstatsd 90.16% <ø> (ø)
dogstatsd-client 82.57% <ø> (ø)
ipc 82.68% <ø> (ø)
profiling 80.04% <ø> (ø)
profiling-ffi 70.68% <ø> (ø)
serverless 0.00% <ø> (ø)
sidecar 40.86% <ø> (ø)
sidecar-ffi 4.70% <ø> (ø)
spawn-worker 54.37% <ø> (ø)
tinybytes 92.00% <ø> (-0.86%) ⬇️
trace-mini-agent 72.48% <ø> (ø)
trace-normalization 98.23% <ø> (ø)
trace-obfuscation 95.96% <ø> (ø)
trace-protobuf 78.13% <ø> (ø)
trace-utils 93.26% <93.75%> (-0.04%) ⬇️

/// from a static str.
pub trait SpanValue: Eq + Hash + Borrow<str> {}
/// Implement the SpanValue trait for any type which satisfies the sub trait.
impl<T: Eq + Hash + Borrow<str>> SpanValue for T {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Makes things way more readable.

Copy link
Contributor

@ganeshnj ganeshnj left a comment

Choose a reason for hiding this comment

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

Nice work 🎉

I played a bit with your PR to see if associated types make sense here, but after playing I bit, I would prefer the current approach.

/// Trait representing the requirements for a type to be used as a Span "string" type.
/// Note: Borrow<str> is not required by the derived traits, but allows to access HashMap elements
/// from a static str.
pub trait SpanValue: Eq + Hash + Borrow<str> {}
Copy link
Contributor

Choose a reason for hiding this comment

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

SpanValue is too broad as name, given this is explicitly targeting the strings, I would prefer SpanString to narrow down the scope.

@VianneyRuhlmann VianneyRuhlmann force-pushed the vianney/add-generic-span branch from a6e6591 to 4be708f Compare February 21, 2025 12:09
@VianneyRuhlmann VianneyRuhlmann merged commit e47f5e9 into main Feb 21, 2025
31 checks passed
@VianneyRuhlmann VianneyRuhlmann deleted the vianney/add-generic-span branch February 21, 2025 12:47
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.

4 participants