Skip to content

Conversation

@morrisonlevi
Copy link
Contributor

What does this PR do?

This adds two new methods to libdd_profiling::internal::Profile with supporting types:

  • Profile::try_new2
  • Profile::try_add_sample2

Motivation

These APIs together are faster than the versions that aren't suffixed with 2.

Additional Notes

This doesn't add the FFI API yet, that's coming next.

How to test the change?

Everything should be the same. There is a benchmark you can run to compare some basic API level tests. Here is what I got locally on my M1:

profile_add_sample_frames_x1000
                        time:   [679.01 µs 681.72 µs 685.57 µs]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

profile_add_sample2_frames_x1000
                        time:   [231.41 µs 235.60 µs 240.77 µs]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

In this basic benchmarking test, it's roughly 3x faster.

@morrisonlevi morrisonlevi added the profiling Relates to the profiling* modules. label Nov 17, 2025
@github-actions github-actions bot removed the profiling Relates to the profiling* modules. label Nov 17, 2025
@pr-commenter
Copy link

pr-commenter bot commented Nov 17, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-12-05 04:17:47

Comparing candidate commit e677b96 in PR branch levi/try_add_sample2 with baseline commit 6b26318 in branch main.

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

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 e677b96 1764907379 levi/try_add_sample2
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.029µs 26.037µs ± 9.900µs 18.405µs ± 0.260µs 34.806µs 43.732µs 50.310µs 72.652µs 294.74% 1.027 1.003 37.93% 0.700µ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.665µs; 27.409µs] or [-5.270%; +5.270%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.002µs 3.912µs ± 0.001µs 3.913µs 3.915µs 3.917µs 3.917µs 0.13% -2.096 15.261 0.06% 0.000µs 1 200
credit_card/is_card_number/ throughput 255293851.613op/s 255636814.383op/s ± 161592.468op/s 255619618.806op/s ± 94135.465op/s 255727460.962op/s 255855266.800op/s 255927916.604op/s 256869371.373op/s 0.49% 2.121 15.483 0.06% 11426.313op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 78.782µs 81.780µs ± 1.176µs 81.680µs ± 0.736µs 82.557µs 83.773µs 84.629µs 85.313µs 4.45% 0.266 0.126 1.43% 0.083µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11721577.652op/s 12230441.738op/s ± 175346.872op/s 12242972.862op/s ± 110256.130op/s 12342959.170op/s 12518625.467op/s 12623784.498op/s 12693318.990op/s 3.68% -0.177 0.088 1.43% 12398.896op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 71.441µs 72.150µs ± 0.660µs 71.914µs ± 0.345µs 72.472µs 73.428µs 74.380µs 74.522µs 3.63% 1.474 2.159 0.91% 0.047µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13418781.042op/s 13861170.325op/s ± 125153.023op/s 13905558.813op/s ± 66752.504op/s 13962843.273op/s 13981258.396op/s 13990861.342op/s 13997472.802op/s 0.66% -1.420 1.947 0.90% 8849.655op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.894µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.920µs 3.920µs 3.923µs 0.25% -0.313 4.687 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254938383.906op/s 255550313.806op/s ± 214548.636op/s 255572628.193op/s ± 118845.440op/s 255685136.761op/s 255826181.047op/s 255911405.285op/s 256780703.352op/s 0.47% 0.330 4.770 0.08% 15170.880op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 68.292µs 69.227µs ± 0.691µs 69.068µs ± 0.336µs 69.454µs 70.733µs 71.328µs 71.469µs 3.48% 1.263 1.203 1.00% 0.049µs 1 200
credit_card/is_card_number/378282246310005 throughput 13992127.416op/s 14446564.760op/s ± 142386.603op/s 14478554.609op/s ± 70614.893op/s 14538486.935op/s 14612577.952op/s 14634354.544op/s 14643074.067op/s 1.14% -1.215 1.071 0.98% 10068.253op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 45.351µs 45.701µs ± 0.140µs 45.702µs ± 0.105µs 45.815µs 45.907µs 45.936µs 45.959µs 0.56% -0.244 -0.728 0.31% 0.010µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 21758668.743op/s 21881487.962op/s ± 67024.603op/s 21880833.484op/s ± 50350.247op/s 21930727.691op/s 21999337.234op/s 22035462.832op/s 22050092.777op/s 0.77% 0.255 -0.717 0.31% 4739.355op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.428µs 6.436µs ± 0.003µs 6.436µs ± 0.002µs 6.437µs 6.441µs 6.444µs 6.446µs 0.16% 0.363 0.320 0.05% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 155128045.024op/s 155380324.304op/s ± 77676.141op/s 155381074.585op/s ± 46150.659op/s 155430363.322op/s 155491902.712op/s 155538498.012op/s 155569897.885op/s 0.12% -0.360 0.316 0.05% 5492.533op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.892µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.913µs 3.916µs 3.917µs 3.920µs 0.20% -2.967 20.346 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255100081.139op/s 255624329.289op/s ± 187598.871op/s 255615876.821op/s ± 92285.250op/s 255710899.677op/s 255823018.911op/s 255916495.252op/s 256931963.070op/s 0.51% 2.997 20.581 0.07% 13265.243op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 61.450µs 62.647µs ± 0.506µs 62.630µs ± 0.333µs 62.963µs 63.443µs 63.914µs 64.096µs 2.34% 0.149 -0.032 0.81% 0.036µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15601677.210op/s 15963595.457op/s ± 128909.366op/s 15966712.134op/s ± 84982.283op/s 16051991.087op/s 16185660.969op/s 16228957.701op/s 16273506.261op/s 1.92% -0.102 -0.064 0.81% 9115.269op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 54.045µs 54.240µs ± 0.076µs 54.235µs ± 0.050µs 54.289µs 54.371µs 54.409µs 54.426µs 0.35% 0.069 -0.207 0.14% 0.005µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18373728.389op/s 18436594.343op/s ± 25927.019op/s 18438328.403op/s ± 17068.436op/s 18452776.588op/s 18480263.823op/s 18493274.742op/s 18503036.348op/s 0.35% -0.062 -0.206 0.14% 1833.317op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.913µs ± 0.002µs 3.913µs ± 0.001µs 3.914µs 3.916µs 3.918µs 3.918µs 0.12% -2.412 16.517 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255236492.188op/s 255557536.630op/s ± 161490.053op/s 255542260.228op/s ± 80592.926op/s 255622335.003op/s 255819147.473op/s 255864878.491op/s 256811895.334op/s 0.50% 2.436 16.750 0.06% 11419.071op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 50.215µs 50.453µs ± 0.093µs 50.450µs ± 0.062µs 50.515µs 50.592µs 50.714µs 50.760µs 0.62% 0.180 0.533 0.18% 0.007µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 19700369.322op/s 19820370.230op/s ± 36471.446op/s 19821694.845op/s ± 24585.689op/s 19843123.580op/s 19879367.192op/s 19907234.642op/s 19914284.094op/s 0.47% -0.166 0.517 0.18% 2578.921op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 45.401µs 45.700µs ± 0.127µs 45.701µs ± 0.092µs 45.792µs 45.901µs 45.922µs 45.933µs 0.51% -0.210 -0.657 0.28% 0.009µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 21770982.328op/s 21881996.903op/s ± 60999.030op/s 21881476.794op/s ± 44202.766op/s 21926306.250op/s 21979697.364op/s 22020948.400op/s 22026089.903op/s 0.66% 0.220 -0.649 0.28% 4313.283op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.429µs 6.438µs ± 0.005µs 6.437µs ± 0.003µs 6.440µs 6.448µs 6.451µs 6.455µs 0.28% 0.951 0.817 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 154919578.894op/s 155330694.751op/s ± 116960.301op/s 155348051.612op/s ± 72096.477op/s 155416003.967op/s 155481093.498op/s 155512766.675op/s 155538522.608op/s 0.12% -0.947 0.805 0.08% 8270.342op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255614419.221op/s; 255659209.545op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [81.617µs; 81.943µs] or [-0.199%; +0.199%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12206140.348op/s; 12254743.128op/s] or [-0.199%; +0.199%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [72.058µs; 72.241µs] or [-0.127%; +0.127%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13843825.320op/s; 13878515.331op/s] or [-0.125%; +0.125%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.914µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/37828224631 throughput [255520579.429op/s; 255580048.184op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/378282246310005 execution_time [69.132µs; 69.323µs] or [-0.138%; +0.138%] None None None
credit_card/is_card_number/378282246310005 throughput [14426831.346op/s; 14466298.173op/s] or [-0.137%; +0.137%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.682µs; 45.721µs] or [-0.042%; +0.042%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [21872198.997op/s; 21890776.927op/s] or [-0.042%; +0.042%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.435µs; 6.436µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 throughput [155369559.138op/s; 155391089.470op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255598329.890op/s; 255650328.689op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [62.576µs; 62.717µs] or [-0.112%; +0.112%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15945729.859op/s; 15981461.055op/s] or [-0.112%; +0.112%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [54.229µs; 54.251µs] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18433001.108op/s; 18440187.579op/s] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.913µs; 3.913µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255535155.662op/s; 255579917.599op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [50.440µs; 50.466µs] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [19815315.638op/s; 19825424.821op/s] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.682µs; 45.718µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [21873543.025op/s; 21890450.782op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.437µs; 6.439µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155314485.178op/s; 155346904.324op/s] or [-0.010%; +0.010%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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 61.581ms 62.028ms ± 1.860ms 61.793ms ± 0.070ms 61.857ms 62.123ms 72.912ms 81.787ms 32.36% 8.711 78.788 2.99% 0.132ms 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 [61.770ms; 62.286ms] or [-0.416%; +0.416%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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 144.262µs 146.491µs ± 1.961µs 146.203µs ± 0.558µs 146.771µs 148.012µs 154.115µs 164.894µs 12.78% 6.025 47.091 1.34% 0.139µ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 [146.219µs; 146.763µs] or [-0.186%; +0.186%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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 188.044ns 191.055ns ± 2.342ns 190.730ns ± 1.774ns 192.295ns 195.413ns 197.082ns 201.396ns 5.59% 1.064 1.476 1.22% 0.166ns 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 [190.731ns; 191.380ns] or [-0.170%; +0.170%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.016µs 5.099µs ± 0.050µs 5.113µs ± 0.050µs 5.129µs 5.169µs 5.173µs 5.174µs 1.20% -0.018 -1.428 0.97% 0.004µ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.092µs; 5.106µs] or [-0.135%; +0.135%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.094ms 6.354ms ± 0.088ms 6.365ms ± 0.021ms 6.387ms 6.439ms 6.585ms 6.894ms 8.31% 0.407 8.265 1.38% 0.006ms 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.342ms; 6.366ms] or [-0.192%; +0.192%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.130µs 161.906µs ± 0.422µs 161.832µs ± 0.157µs 162.031µs 162.360µs 162.761µs 165.844µs 2.48% 5.216 42.329 0.26% 0.030µ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 [161.848µs; 161.964µs] or [-0.036%; +0.036%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 248.397ns 258.716ns ± 14.251ns 251.112ns ± 1.285ns 258.416ns 291.262ns 294.871ns 302.760ns 20.57% 1.545 0.874 5.49% 1.008ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [256.741ns; 260.691ns] or [-0.763%; +0.763%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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 85.650µs 85.806µs ± 0.223µs 85.787µs ± 0.045µs 85.828µs 85.916µs 86.153µs 88.753µs 3.46% 11.649 150.870 0.26% 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 [85.775µs; 85.837µs] or [-0.036%; +0.036%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.774µs 205.659µs ± 0.718µs 205.360µs ± 0.264µs 205.871µs 207.291µs 207.608µs 207.797µs 1.19% 1.364 0.730 0.35% 0.051µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4812377.748op/s 4862466.446op/s ± 16899.028op/s 4869488.496op/s ± 6273.787op/s 4873990.870op/s 4877873.055op/s 4880745.230op/s 4883434.401op/s 0.29% -1.355 0.705 0.35% 1194.942op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.573µs 18.640µs ± 0.055µs 18.625µs ± 0.019µs 18.650µs 18.773µs 18.848µs 18.921µs 1.59% 2.547 7.509 0.29% 0.004µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52850098.310op/s 53648180.072op/s ± 156459.775op/s 53691324.029op/s ± 54198.181op/s 53735095.774op/s 53785602.797op/s 53816472.779op/s 53840738.184op/s 0.28% -2.520 7.351 0.29% 11063.377op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.778µs 10.859µs ± 0.035µs 10.860µs ± 0.019µs 10.879µs 10.916µs 10.968µs 10.977µs 1.08% 0.273 0.807 0.32% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 91100078.652op/s 92089914.913op/s ± 298054.248op/s 92084623.665op/s ± 163157.209op/s 92250370.337op/s 92632056.910op/s 92715221.432op/s 92780212.176op/s 0.76% -0.247 0.768 0.32% 21075.618op/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.560µs; 205.759µs] or [-0.048%; +0.048%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4860124.403op/s; 4864808.489op/s] or [-0.048%; +0.048%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.633µs; 18.648µs] or [-0.041%; +0.041%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53626496.252op/s; 53669863.892op/s] or [-0.040%; +0.040%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.854µs; 10.864µs] or [-0.045%; +0.045%] None None None
normalization/normalize_name/normalize_name/good throughput [92048607.460op/s; 92131222.365op/s] or [-0.045%; +0.045%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.324µs 2.392µs ± 0.019µs 2.398µs ± 0.005µs 2.402µs 2.408µs 2.411µs 2.415µs 0.73% -2.379 5.135 0.79% 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.390µs; 2.395µs] or [-0.110%; +0.110%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.613ms 10.640ms ± 0.013ms 10.639ms ± 0.008ms 10.646ms 10.662ms 10.676ms 10.706ms 0.63% 0.945 2.707 0.12% 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.638ms; 10.641ms] or [-0.017%; +0.017%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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 533.009µs 533.754µs ± 0.477µs 533.722µs ± 0.241µs 533.952µs 534.425µs 534.526µs 538.427µs 0.88% 4.782 44.296 0.09% 0.034µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1857260.364op/s 1873522.380op/s ± 1666.523op/s 1873634.073op/s ± 844.483op/s 1874498.313op/s 1875318.140op/s 1876026.207op/s 1876139.272op/s 0.13% -4.720 43.494 0.09% 117.841op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 379.661µs 380.385µs ± 0.325µs 380.375µs ± 0.192µs 380.566µs 380.859µs 381.174µs 382.260µs 0.50% 1.012 4.679 0.09% 0.023µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2616018.724op/s 2628917.754op/s ± 2242.924op/s 2628985.156op/s ± 1328.370op/s 2630455.962op/s 2632248.484op/s 2633226.091op/s 2633928.991op/s 0.19% -0.998 4.596 0.09% 158.599op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.343µs 189.843µs ± 0.164µs 189.836µs ± 0.107µs 189.946µs 190.129µs 190.269µs 190.329µs 0.26% 0.181 0.517 0.09% 0.012µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5254062.198op/s 5267501.464op/s ± 4546.013op/s 5267711.871op/s ± 2977.918op/s 5270659.516op/s 5274039.321op/s 5278358.621op/s 5281411.193op/s 0.26% -0.174 0.517 0.09% 321.452op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.903µs 37.007µs ± 0.051µs 37.006µs ± 0.035µs 37.040µs 37.096µs 37.133µs 37.190µs 0.50% 0.525 0.426 0.14% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26888603.953op/s 27022243.383op/s ± 37121.440op/s 27022993.112op/s ± 25527.374op/s 27048509.851op/s 27077892.960op/s 27089515.312op/s 27098375.295op/s 0.28% -0.516 0.408 0.14% 2624.882op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 44.925µs 45.155µs ± 0.186µs 45.135µs ± 0.140µs 45.287µs 45.400µs 45.475µs 46.537µs 3.10% 2.140 13.385 0.41% 0.013µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21488473.106op/s 22146490.341op/s ± 90346.619op/s 22155544.977op/s ± 68680.588op/s 22221857.351op/s 22255404.756op/s 22258887.722op/s 22259299.070op/s 0.47% -2.012 12.160 0.41% 6388.471op/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 [533.688µs; 533.820µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1873291.416op/s; 1873753.344op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [380.340µs; 380.430µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2628606.906op/s; 2629228.601op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [189.821µs; 189.866µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5266871.430op/s; 5268131.497op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.000µs; 37.014µs] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27017098.708op/s; 27027388.057op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.129µs; 45.180µs] or [-0.057%; +0.057%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [22133969.168op/s; 22159011.513op/s] or [-0.057%; +0.057%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.362µs 35.060µs ± 1.251µs 34.497µs ± 0.059µs 34.571µs 37.728µs 37.772µs 39.339µs 14.04% 1.743 1.179 3.56% 0.088µ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.887µs; 35.233µs] or [-0.495%; +0.495%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_frames_x1000 execution_time 3.923ms 3.928ms ± 0.007ms 3.927ms ± 0.001ms 3.929ms 3.933ms 3.936ms 4.019ms 2.35% 11.427 147.063 0.18% 0.000ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_frames_x1000 execution_time [3.927ms; 3.929ms] or [-0.025%; +0.025%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.138µs 3.174µs ± 1.433µs 3.002µs ± 0.023µs 3.020µs 3.338µs 13.812µs 15.173µs 405.41% 7.478 56.665 45.04% 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.975µs; 3.372µs] or [-6.258%; +6.258%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
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.179ms 14.243ms ± 0.032ms 14.240ms ± 0.015ms 14.257ms 14.306ms 14.340ms 14.394ms 1.08% 1.288 3.397 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.239ms; 14.248ms] or [-0.031%; +0.031%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz e677b96 1764907379 levi/try_add_sample2
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample2_frames_x1000 execution_time 524.164µs 524.978µs ± 0.467µs 524.894µs ± 0.234µs 525.167µs 525.818µs 526.355µs 527.795µs 0.55% 1.859 6.524 0.09% 0.033µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample2_frames_x1000 execution_time [524.913µs; 525.042µs] or [-0.012%; +0.012%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 92.09184% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.12%. Comparing base (6b26318) to head (e677b96).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1351      +/-   ##
==========================================
+ Coverage   70.96%   71.12%   +0.16%     
==========================================
  Files         400      403       +3     
  Lines       63691    64083     +392     
==========================================
+ Hits        45199    45582     +383     
- Misses      18492    18501       +9     
Components Coverage Δ
libdd-crashtracker 58.63% <ø> (-0.07%) ⬇️
libdd-crashtracker-ffi 16.74% <ø> (ø)
libdd-alloc 98.73% <ø> (ø)
libdd-data-pipeline 85.81% <ø> (ø)
libdd-data-pipeline-ffi 76.59% <ø> (ø)
libdd-common 81.15% <ø> (ø)
libdd-common-ffi 74.96% <ø> (ø)
libdd-telemetry 60.02% <ø> (+0.03%) ⬆️
libdd-telemetry-ffi 21.24% <ø> (ø)
libdd-dogstatsd-client 83.75% <ø> (ø)
datadog-ipc 82.61% <ø> (ø)
libdd-profiling 80.32% <92.09%> (+0.68%) ⬆️
libdd-profiling-ffi 62.13% <ø> (ø)
datadog-sidecar 35.88% <ø> (ø)
datdog-sidecar-ffi 10.82% <ø> (ø)
spawn-worker 55.18% <ø> (ø)
libdd-tinybytes 92.44% <ø> (ø)
libdd-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
libdd-trace-protobuf 59.65% <ø> (ø)
libdd-trace-utils 89.88% <ø> (ø)
datadog-tracer-flare 63.49% <ø> (ø)
libdd-log 75.57% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-official

This comment has been minimized.

@dd-octo-sts
Copy link

dd-octo-sts bot commented Nov 18, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.44 MB 7.44 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 86.25 MB 86.30 MB +.05% (+50.89 KB) 🔍
aarch64-apple-darwin
Artifact Baseline Commit Change
/aarch64-apple-darwin/lib/libdatadog_profiling.a 58.31 MB 58.37 MB +.09% (+56.71 KB) 🔍
/aarch64-apple-darwin/lib/libdatadog_profiling.dylib 8.43 MB 8.45 MB +.21% (+18.48 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.04 MB 100.09 MB +.05% (+55.57 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.54 MB 9.60 MB +.68% (+67.09 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 19.69 MB 19.71 MB +.14% (+28.50 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 69.82 KB 69.82 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 139.73 MB 140.14 MB +.29% (+416.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 742.46 MB 744.59 MB +.28% (+2.12 MB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 6.37 MB 6.37 MB +.06% (+4.00 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 69.82 KB 69.82 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 19.73 MB 19.74 MB +.07% (+16.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 38.75 MB 38.78 MB +.07% (+30.11 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 16.80 MB 16.82 MB +.13% (+24.00 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 70.90 KB 70.90 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 142.34 MB 142.74 MB +.27% (+408.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 730.71 MB 733.09 MB +.32% (+2.38 MB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.88 MB 4.89 MB +.04% (+2.50 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 70.90 KB 70.90 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 20.97 MB 20.99 MB +.11% (+24.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 36.51 MB 36.54 MB +.07% (+28.44 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 74.59 MB 74.64 MB +.06% (+51.07 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.86 MB 8.86 MB 0% (0 B) 👌
x86_64-apple-darwin
Artifact Baseline Commit Change
/x86_64-apple-darwin/lib/libdatadog_profiling.a 59.67 MB 59.73 MB +.09% (+56.80 KB) 🔍
/x86_64-apple-darwin/lib/libdatadog_profiling.dylib 9.49 MB 9.49 MB +.06% (+6.32 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.25 MB 94.30 MB +.05% (+53.92 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.29 MB 10.30 MB +.02% (+2.42 KB) 🔍

@morrisonlevi morrisonlevi marked this pull request as ready for review November 18, 2025 16:11
@morrisonlevi morrisonlevi requested a review from a team as a code owner November 18, 2025 16:11
Comment on lines +21 to +37
#[derive(Copy, Clone, Debug, Default)]
pub struct Label<'a> {
pub key: StringId2,

/// At most one of `.str` and `.num` should not be empty.
pub str: &'a str,
pub num: i64,

/// Should only be present when num is present.
/// Specifies the units of num.
/// Use arbitrary string (for example, "requests") as a custom count unit.
/// If no unit is specified, consumer may apply heuristic to deduce the unit.
/// Consumers may also interpret units like "bytes" and "kilobytes" as memory
/// units and units like "seconds" and "nanoseconds" as time units,
/// and apply appropriate unit conversions to these.
pub num_unit: &'a str,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use Rust enums here to enforce this?

Copy link
Contributor Author

@morrisonlevi morrisonlevi Dec 3, 2025

Choose a reason for hiding this comment

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

Some of the code does model it this way, such as the internal::Label. But the api2::Label is meant to be more similar to api::Label for easier adoption, and it does not use enums because it more closely mirrors the FFI.

Comment on lines 58 to 61
let internal_id = functions.dedup(function);
self.functions.try_reserve(1)?;
self.functions.insert(set_id, internal_id);
Ok(internal_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

so this both functions and self.functions? Why do we need both

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One is the internal function "table" and the other is a HashMap that converts from the ProfilesDictionary IDs into the internal IDs.

Comment on lines +38 to +43
locations.push(Location2 {
mapping: MappingId2::default(),
function: frame.function,
address: 0,
line: frame.line_number as i64,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this make sense as a .into() function

Base automatically changed from levi/profiles_dictionary to main December 3, 2025 22:26
@morrisonlevi
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Dec 5, 2025

View all feedbacks in Devflow UI.

2025-12-05 21:41:27 UTC ℹ️ Start processing command /merge


2025-12-05 21:41:31 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-12-05 21:59:51 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit f6d7637:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

@morrisonlevi
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Dec 5, 2025

View all feedbacks in Devflow UI.

2025-12-05 22:04:45 UTC ℹ️ Start processing command /merge


2025-12-05 22:04:50 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-12-05 22:22:16 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit f646506 into main Dec 5, 2025
29 checks passed
@dd-mergequeue dd-mergequeue bot deleted the levi/try_add_sample2 branch December 5, 2025 22:22
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