Skip to content

Conversation

@morrisonlevi
Copy link
Contributor

What does this PR do?

Adds FFI bindings for ProfilesDictionary and supporting infrastructure:

  • ArcHandle<T>: Generic FFI-safe wrapper for Arc<T> with transparent representation.
    • ArcHandle<ProfilesDictionary> is renamed to ddog_prof_ProfilesDictionaryHandle.
    • Also rename ProfileStatus to ddog_prof_Status.
  • Utf8Option: UTF-8 validation strategy enum (Assume, Validate, ConvertLossy).
  • ProfilesDictionary FFI:
    • ddog_prof_ProfilesDictionary_new / _drop / _try_clone
    • ddog_prof_ProfilesDictionary_insert_str / _insert_function / _insert_mapping
    • ddog_prof_ProfilesDictionary_get_str
  • As well as helper macros ensure_non_null_out_parameter! and ensure_non_null_insert! for consistent null-pointer error handling.

Motivation

This is part of the larger effort to add dictionary-based profiling APIs that enable efficient ID-based references for repeated data (strings, functions, mappings). What comes next is the ddog_prof_Profile_add2 API which uses the IDs created by this PR. This eliminates redundant string copies and enables concurrent insertion from multiple threads.

Additional Notes

Depends on these PRs, merge them first:

How to test the change?

Run the comprehensive test suite:

cargo test -p "libdd-profiling-ffi" --lib

@morrisonlevi morrisonlevi requested a review from a team as a code owner December 14, 2025 20:13
@pr-commenter
Copy link

pr-commenter bot commented Dec 14, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-12-17 19:53:07

Comparing candidate commit 6289fee in PR branch levi/profiles-dictionary-ffi with baseline commit b656c23 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 57 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 6289fee 1766000200 levi/profiles-dictionary-ffi
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.703ms 10.736ms ± 0.015ms 10.734ms ± 0.008ms 10.743ms 10.761ms 10.788ms 10.807ms 0.68% 1.217 3.118 0.14% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.734ms; 10.738ms] or [-0.020%; +0.020%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 9.545ms 9.920ms ± 0.081ms 9.926ms ± 0.041ms 9.967ms 10.028ms 10.092ms 10.142ms 2.18% -1.263 3.836 0.82% 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 [9.908ms; 9.931ms] or [-0.114%; +0.114%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 534.099µs 534.903µs ± 0.485µs 534.821µs ± 0.260µs 535.140µs 535.621µs 536.080µs 539.090µs 0.80% 3.577 26.710 0.09% 0.034µ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 [534.836µs; 534.970µs] or [-0.013%; +0.013%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.320µs 2.386µs ± 0.020µs 2.383µs ± 0.007µs 2.395µs 2.420µs 2.430µs 2.529µs 6.14% 1.545 12.264 0.86% 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.383µs; 2.388µs] or [-0.119%; +0.119%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 241.589ns 255.904ns ± 14.624ns 249.776ns ± 4.845ns 266.290ns 285.371ns 294.559ns 296.342ns 18.64% 1.232 0.264 5.70% 1.034ns 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.877ns; 257.931ns] or [-0.792%; +0.792%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 186.367ns 189.173ns ± 2.441ns 188.706ns ± 1.605ns 190.590ns 192.521ns 197.798ns 204.686ns 8.47% 1.973 8.022 1.29% 0.173ns 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 [188.835ns; 189.511ns] or [-0.179%; +0.179%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.912µs 534.652µs ± 0.524µs 534.607µs ± 0.256µs 534.858µs 535.267µs 535.797µs 539.872µs 0.98% 5.158 47.763 0.10% 0.037µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1852291.721op/s 1870375.723op/s ± 1822.242op/s 1870534.374op/s ± 896.112op/s 1871446.179op/s 1872371.194op/s 1872595.119op/s 1872967.211op/s 0.13% -5.090 46.862 0.10% 128.852op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 380.150µs 380.934µs ± 0.323µs 380.882µs ± 0.215µs 381.127µs 381.529µs 381.655µs 381.870µs 0.26% 0.362 -0.243 0.08% 0.023µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2618692.225op/s 2625127.207op/s ± 2225.797op/s 2625488.205op/s ± 1478.731op/s 2626664.845op/s 2628183.810op/s 2629561.166op/s 2630539.674op/s 0.19% -0.358 -0.246 0.08% 157.388op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.791µs 190.302µs ± 0.190µs 190.301µs ± 0.127µs 190.427µs 190.627µs 190.729µs 190.779µs 0.25% -0.050 -0.058 0.10% 0.013µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5241660.015op/s 5254804.891op/s ± 5236.182op/s 5254829.593op/s ± 3516.209op/s 5258399.079op/s 5262877.457op/s 5268284.277op/s 5268945.914op/s 0.27% 0.056 -0.055 0.10% 370.254op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.278µs 37.389µs ± 0.039µs 37.388µs ± 0.025µs 37.411µs 37.457µs 37.486µs 37.506µs 0.32% 0.206 0.317 0.10% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26662213.385op/s 26746079.098op/s ± 28000.127op/s 26746757.457op/s ± 17650.051op/s 26764665.945op/s 26792021.885op/s 26804540.667op/s 26825309.728op/s 0.29% -0.199 0.313 0.10% 1979.908op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.798µs 45.903µs ± 0.114µs 45.894µs ± 0.028µs 45.924µs 45.961µs 45.996µs 47.404µs 3.29% 11.517 149.599 0.25% 0.008µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21095375.003op/s 21785306.054op/s ± 52547.013op/s 21789367.031op/s ± 13122.280op/s 21801932.112op/s 21821267.224op/s 21829055.441op/s 21835242.421op/s 0.21% -11.376 147.142 0.24% 3715.635op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [534.580µs; 534.725µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1870123.178op/s; 1870628.269op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [380.889µs; 380.979µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2624818.733op/s; 2625435.681op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.276µs; 190.328µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5254079.206op/s; 5255530.575op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.383µs; 37.394µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26742198.549op/s; 26749959.646op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.887µs; 45.919µs] or [-0.034%; +0.034%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21778023.543op/s; 21792588.565op/s] or [-0.033%; +0.033%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 13.874ms 13.920ms ± 0.037ms 13.913ms ± 0.010ms 13.923ms 13.998ms 14.109ms 14.206ms 2.11% 4.388 24.583 0.27% 0.003ms 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 [13.915ms; 13.925ms] or [-0.037%; +0.037%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.984µs 34.510µs ± 0.943µs 34.065µs ± 0.042µs 34.194µs 36.515µs 36.540µs 37.870µs 11.17% 1.739 1.233 2.72% 0.067µ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.379µs; 34.640µs] or [-0.379%; +0.379%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.283µs 146.481µs ± 1.568µs 146.282µs ± 0.576µs 146.820µs 148.096µs 151.439µs 161.098µs 10.13% 5.123 40.182 1.07% 0.111µ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.264µs; 146.699µs] or [-0.148%; +0.148%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.811µs 25.156µs ± 9.412µs 18.108µs ± 0.177µs 33.473µs 43.231µs 50.439µs 68.741µs 279.63% 1.144 1.203 37.32% 0.666µ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.851µs; 26.460µs] or [-5.185%; +5.185%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.080ms 61.605ms ± 1.939ms 61.290ms ± 0.079ms 61.422ms 61.887ms 74.996ms 80.562ms 31.44% 8.098 66.761 3.14% 0.137ms 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.336ms; 61.874ms] or [-0.436%; +0.436%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.975µs 5.062µs ± 0.039µs 5.078µs ± 0.029µs 5.091µs 5.121µs 5.125µs 5.128µs 0.97% -0.330 -1.053 0.76% 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.056µs; 5.067µs] or [-0.106%; +0.106%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.913µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.920µs 0.20% -0.934 6.507 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 255070244.609op/s 255592750.214op/s ± 199440.003op/s 255586390.058op/s ± 127863.133op/s 255720092.549op/s 255862774.930op/s 255917752.346op/s 256845779.082op/s 0.49% 0.951 6.624 0.08% 14102.538op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 77.078µs 79.278µs ± 1.172µs 79.202µs ± 0.937µs 80.249µs 81.207µs 81.661µs 81.957µs 3.48% 0.177 -0.971 1.47% 0.083µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12201516.793op/s 12616518.340op/s ± 186089.648op/s 12625923.079op/s ± 148943.301op/s 12764954.560op/s 12905421.160op/s 12965464.348op/s 12973927.615op/s 2.76% -0.133 -0.990 1.47% 13158.525op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.622µs 70.925µs ± 0.291µs 70.830µs ± 0.135µs 71.016µs 71.543µs 71.952µs 72.254µs 2.01% 1.737 3.368 0.41% 0.021µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13840090.029op/s 14099578.485op/s ± 57419.487op/s 14118237.941op/s ± 26827.360op/s 14140903.631op/s 14151944.571op/s 14157470.044op/s 14159808.198op/s 0.29% -1.708 3.224 0.41% 4060.171op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.890µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.920µs 3.924µs 0.28% -1.617 11.851 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254810786.797op/s 255536912.573op/s ± 210818.822op/s 255528476.522op/s ± 126441.298op/s 255663734.144op/s 255848406.166op/s 255958477.639op/s 257039871.739op/s 0.59% 1.644 12.061 0.08% 14907.142op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.421µs 67.665µs ± 0.266µs 67.560µs ± 0.072µs 67.753µs 68.178µs 68.724µs 69.287µs 2.56% 2.735 10.077 0.39% 0.019µs 1 200
credit_card/is_card_number/378282246310005 throughput 14432674.014op/s 14778807.884op/s ± 57443.797op/s 14801723.662op/s ± 15899.679op/s 14812853.855op/s 14822831.162op/s 14829229.124op/s 14832135.304op/s 0.21% -2.683 9.652 0.39% 4061.890op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 44.556µs 45.136µs ± 0.206µs 45.137µs ± 0.155µs 45.304µs 45.447µs 45.510µs 45.518µs 0.84% -0.273 -0.553 0.46% 0.015µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 21969463.435op/s 22155739.497op/s ± 101275.980op/s 22155007.674op/s ± 76168.328op/s 22216328.493op/s 22328789.946op/s 22374162.087op/s 22443850.188op/s 1.30% 0.292 -0.534 0.46% 7161.293op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.026µs 6.035µs ± 0.007µs 6.034µs ± 0.003µs 6.037µs 6.045µs 6.047µs 6.113µs 1.30% 6.799 70.933 0.12% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163589014.637op/s 165693387.003op/s ± 192558.923op/s 165716231.906op/s ± 72897.191op/s 165783057.312op/s 165874346.382op/s 165916903.666op/s 165937090.916op/s 0.13% -6.706 69.545 0.12% 13615.972op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.893µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.920µs 0.21% -0.918 7.773 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255098884.987op/s 255618404.016op/s ± 196017.970op/s 255644486.802op/s ± 112393.528op/s 255741378.966op/s 255886689.812op/s 255934378.069op/s 256893398.282op/s 0.49% 0.939 7.910 0.08% 13860.564op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.518µs 65.850µs ± 0.077µs 65.867µs ± 0.031µs 65.894µs 65.934µs 65.978µs 66.009µs 0.21% -1.689 3.426 0.12% 0.005µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15149544.442op/s 15186070.079op/s ± 17839.813op/s 15182099.546op/s ± 7074.884op/s 15190273.288op/s 15229331.162op/s 15245064.216op/s 15262999.557op/s 0.53% 1.698 3.457 0.12% 1261.465op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 52.922µs 53.021µs ± 0.036µs 53.022µs ± 0.024µs 53.045µs 53.080µs 53.103µs 53.120µs 0.19% 0.057 -0.122 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18825141.824op/s 18860596.013op/s ± 12651.856op/s 18860116.520op/s ± 8538.747op/s 18868901.221op/s 18881455.201op/s 18888116.468op/s 18895618.106op/s 0.19% -0.053 -0.123 0.07% 894.621op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.911µs ± 0.002µs 3.911µs ± 0.002µs 3.913µs 3.915µs 3.917µs 3.918µs 0.17% -1.123 8.206 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255234707.129op/s 255660339.362op/s ± 160986.853op/s 255658468.282op/s ± 109118.303op/s 255769556.532op/s 255875982.545op/s 255917849.597op/s 256725154.889op/s 0.42% 1.140 8.327 0.06% 11383.490op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 49.742µs 49.807µs ± 0.036µs 49.802µs ± 0.027µs 49.835µs 49.871µs 49.882µs 49.927µs 0.25% 0.340 -0.486 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 20029069.055op/s 20077489.720op/s ± 14420.012op/s 20079404.555op/s ± 10989.252op/s 20088235.827op/s 20098320.383op/s 20101769.297op/s 20103628.705op/s 0.12% -0.337 -0.491 0.07% 1019.649op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 44.563µs 45.161µs ± 0.194µs 45.184µs ± 0.128µs 45.301µs 45.453µs 45.531µs 45.567µs 0.85% -0.451 -0.141 0.43% 0.014µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 21945886.387op/s 22143312.018op/s ± 95170.669op/s 22131567.026op/s ± 62659.480op/s 22203194.020op/s 22315097.818op/s 22387823.121op/s 22440102.363op/s 1.39% 0.472 -0.113 0.43% 6729.583op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.027µs 6.041µs ± 0.021µs 6.037µs ± 0.003µs 6.040µs 6.055µs 6.175µs 6.177µs 2.32% 4.768 24.608 0.35% 0.002µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 161884781.518op/s 165539186.885op/s ± 572960.604op/s 165643461.721op/s ± 92048.795op/s 165740376.327op/s 165866770.072op/s 165913654.714op/s 165917711.640op/s 0.17% -4.728 24.189 0.35% 40514.433op/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.912µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255565109.748op/s; 255620390.681op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [79.116µs; 79.441µs] or [-0.205%; +0.205%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12590728.104op/s; 12642308.575op/s] or [-0.204%; +0.204%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [70.885µs; 70.966µs] or [-0.057%; +0.057%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14091620.697op/s; 14107536.274op/s] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255507695.112op/s; 255566130.034op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.629µs; 67.702µs] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/378282246310005 throughput [14770846.727op/s; 14786769.042op/s] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.107µs; 45.165µs] or [-0.063%; +0.063%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [22141703.620op/s; 22169775.374op/s] or [-0.063%; +0.063%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.034µs; 6.036µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number/x371413321323331 throughput [165666700.188op/s; 165720073.818op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.912µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ throughput [255591237.811op/s; 255645570.222op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.839µs; 65.861µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15183597.652op/s; 15188542.505op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [53.016µs; 53.026µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18858842.587op/s; 18862349.438op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255638028.133op/s; 255682650.592op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [49.802µs; 49.812µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [20075491.245op/s; 20079488.195op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.134µs; 45.188µs] or [-0.059%; +0.059%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [22130122.279op/s; 22156501.758op/s] or [-0.060%; +0.060%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.038µs; 6.044µs] or [-0.049%; +0.049%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165459780.056op/s; 165618593.715op/s] or [-0.048%; +0.048%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.236µs 3.228µs ± 1.465µs 3.015µs ± 0.026µs 3.035µs 3.650µs 13.966µs 15.523µs 414.80% 7.418 56.111 45.27% 0.104µ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.025µs; 3.431µs] or [-6.290%; +6.290%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.925ms 3.931ms ± 0.006ms 3.931ms ± 0.001ms 3.932ms 3.935ms 3.938ms 4.013ms 2.08% 11.527 149.364 0.16% 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.931ms; 3.932ms] or [-0.022%; +0.022%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.314µs 162.170µs ± 0.286µs 162.116µs ± 0.122µs 162.278µs 162.694µs 163.136µs 163.336µs 0.75% 1.217 3.440 0.18% 0.020µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [162.130µs; 162.209µs] or [-0.024%; +0.024%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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.301µs 204.821µs ± 0.324µs 204.771µs ± 0.212µs 204.989µs 205.469µs 205.674µs 205.899µs 0.55% 0.849 0.273 0.16% 0.023µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4856750.154op/s 4882328.763op/s ± 7706.667op/s 4883501.756op/s ± 5060.638op/s 4888388.996op/s 4892216.181op/s 4893496.054op/s 4894736.055op/s 0.23% -0.842 0.255 0.16% 544.944op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.625µs 18.705µs ± 0.071µs 18.676µs ± 0.021µs 18.717µs 18.857µs 18.911µs 19.090µs 2.22% 2.051 4.899 0.38% 0.005µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52382795.714op/s 53463120.828op/s ± 200865.212op/s 53544716.987op/s ± 59552.936op/s 53576716.929op/s 53638777.387op/s 53669392.757op/s 53692081.374op/s 0.28% -2.021 4.690 0.37% 14203.315op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.865µs 10.948µs ± 0.044µs 10.946µs ± 0.027µs 10.971µs 11.017µs 11.098µs 11.120µs 1.59% 0.905 1.720 0.40% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 89926129.144op/s 91341955.317op/s ± 364458.338op/s 91358697.496op/s ± 222911.428op/s 91600224.217op/s 91849553.345op/s 91991098.639op/s 92037613.649op/s 0.74% -0.871 1.605 0.40% 25771.096op/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 [204.776µs; 204.866µs] or [-0.022%; +0.022%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4881260.693op/s; 4883396.833op/s] or [-0.022%; +0.022%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.695µs; 18.715µs] or [-0.052%; +0.052%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53435282.841op/s; 53490958.815op/s] or [-0.052%; +0.052%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.942µs; 10.954µs] or [-0.055%; +0.055%] None None None
normalization/normalize_name/normalize_name/good throughput [91291444.897op/s; 91392465.738op/s] or [-0.055%; +0.055%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 6289fee 1766000200 levi/profiles-dictionary-ffi
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 89.115µs 89.472µs ± 0.163µs 89.470µs ± 0.057µs 89.521µs 89.610µs 89.729µs 91.352µs 2.10% 7.641 86.581 0.18% 0.012µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [89.450µs; 89.495µs] or [-0.025%; +0.025%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2025

Codecov Report

❌ Patch coverage is 85.43046% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.73%. Comparing base (b656c23) to head (6289fee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1405      +/-   ##
==========================================
+ Coverage   71.62%   71.73%   +0.10%     
==========================================
  Files         408      411       +3     
  Lines       65717    66018     +301     
==========================================
+ Hits        47073    47360     +287     
- Misses      18644    18658      +14     
Components Coverage Δ
libdd-crashtracker 58.99% <ø> (ø)
libdd-crashtracker-ffi 16.74% <ø> (ø)
libdd-alloc 98.73% <ø> (ø)
libdd-data-pipeline 86.62% <ø> (ø)
libdd-data-pipeline-ffi 81.08% <ø> (ø)
libdd-common 81.33% <ø> (ø)
libdd-common-ffi 74.96% <ø> (ø)
libdd-telemetry 59.95% <ø> (ø)
libdd-telemetry-ffi 21.17% <ø> (ø)
libdd-dogstatsd-client 83.75% <ø> (ø)
datadog-ipc 82.71% <ø> (+0.10%) ⬆️
libdd-profiling 82.74% <85.43%> (+0.46%) ⬆️
libdd-profiling-ffi 72.55% <85.23%> (+1.89%) ⬆️
datadog-sidecar 36.22% <ø> (ø)
datdog-sidecar-ffi 12.62% <ø> (ø)
spawn-worker 55.18% <ø> (ø)
libdd-tinybytes 92.44% <ø> (ø)
libdd-trace-normalization 82.33% <ø> (ø)
libdd-trace-obfuscation 94.17% <ø> (ø)
libdd-trace-protobuf 61.18% <ø> (ø)
libdd-trace-utils 90.07% <ø> (ø)
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.

@dd-octo-sts
Copy link

dd-octo-sts bot commented Dec 14, 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.48 MB 86.83 MB +.40% (+362.85 KB) 🔍
aarch64-apple-darwin
Artifact Baseline Commit Change
/aarch64-apple-darwin/lib/libdatadog_profiling.a 58.49 MB 58.77 MB +.49% (+293.68 KB) 🔍
/aarch64-apple-darwin/lib/libdatadog_profiling.dylib 8.45 MB 8.49 MB +.47% (+41.01 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.61 MB 9.62 MB +.10% (+10.03 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.27 MB 100.64 MB +.36% (+378.17 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 19.72 MB 19.94 MB +1.13% (+229.00 KB) ⚠️
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 69.82 KB 73.77 KB +5.65% (+3.94 KB) 🚨
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 140.15 MB 141.26 MB +.79% (+1.10 MB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 744.89 MB 746.25 MB +.18% (+1.36 MB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 6.37 MB 6.40 MB +.45% (+29.50 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 69.82 KB 73.77 KB +5.65% (+3.94 KB) 🚨
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 19.75 MB 19.87 MB +.63% (+128.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 38.79 MB 38.97 MB +.46% (+183.11 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 16.83 MB 17.01 MB +1.07% (+184.50 KB) ⚠️
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 70.90 KB 74.91 KB +5.65% (+4.01 KB) 🚨
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 142.76 MB 143.89 MB +.78% (+1.12 MB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 733.41 MB 734.79 MB +.18% (+1.37 MB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.89 MB 4.91 MB +.45% (+23.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 70.90 KB 74.91 KB +5.65% (+4.01 KB) 🚨
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 20.98 MB 21.12 MB +.67% (+144.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 36.54 MB 36.72 MB +.48% (+181.91 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 74.80 MB 75.13 MB +.43% (+331.21 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.88 MB 8.91 MB +.30% (+28.00 KB) 🔍
x86_64-apple-darwin
Artifact Baseline Commit Change
/x86_64-apple-darwin/lib/libdatadog_profiling.a 59.83 MB 60.12 MB +.48% (+296.82 KB) 🔍
/x86_64-apple-darwin/lib/libdatadog_profiling.dylib 9.50 MB 9.54 MB +.37% (+36.50 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.46 MB 94.81 MB +.36% (+353.84 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.32 MB 10.35 MB +.25% (+27.25 KB) 🔍

@morrisonlevi morrisonlevi requested a review from a team as a code owner December 17, 2025 19:09
Base automatically changed from levi/profile-status-error to main December 17, 2025 19:22
@gyuheon0h
Copy link
Contributor

Seems like stacking is weird; the diffs might be messed up because the PR below this just went in, but LGTM

@morrisonlevi morrisonlevi force-pushed the levi/profiles-dictionary-ffi branch from 7e79afb to 6289fee Compare December 17, 2025 19:37
@morrisonlevi
Copy link
Contributor Author

I just rebased to fix the stacking. Sometimes it works out of the box, sometimes it doesn't :(

@morrisonlevi
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

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

View all feedbacks in Devflow UI.

2025-12-17 19:41:07 UTC ℹ️ Start processing command /merge


2025-12-17 19:41:15 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-12-17 20:04:21 UTC ℹ️ MergeQueue: merge request added to the queue

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


2025-12-17 20:29:57 UTC ℹ️ MergeQueue: This merge request was merged

/// - `function` must be non-null and point to a valid `Function` for the duration of the call.
#[no_mangle]
pub unsafe extern "C" fn ddog_prof_ProfilesDictionary_insert_function(
function_id: *mut FunctionId2,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the convention that out params go first in the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't specifically discussed. It's pretty usual for out parameters to go early but the "this" pointer might go before it in some other languages, I'm not sure.

@dd-mergequeue dd-mergequeue bot merged commit 3757554 into main Dec 17, 2025
37 of 38 checks passed
@dd-mergequeue dd-mergequeue bot deleted the levi/profiles-dictionary-ffi branch December 17, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants