Skip to content

Conversation

@morrisonlevi
Copy link
Contributor

What does this PR do?

Adds FFI bindings for dictionary-based profiling APIs, which enable more efficient profile creation by pre-registering strings, functions, and mappings in a shared dictionary.

  • ddog_prof_Profile_with_dictionary: create a profile with a ProfilesDictionary for string/function/mapping reuse.
  • ddog_prof_Profile_add2: Add samples using dictionary IDs instead of raw strings/pointers.
  • Supporting types Label2 and Sample2 for ID-based sample construction.

Motivation

This completes the FFI layer for the dictionary-based profiling API introduced in earlier PRs. The new APIs allow profiling clients to:

  1. Create profiles with a shared ProfilesDictionary for deduplication. This can and should live beyond a minute, possibly forever.
  2. Add samples using pre-registered IDs (StringId2, FunctionId2, MappingId2) instead of raw strings.

The C example demonstrates both the old and new APIs side-by-side, showing how to use the dictionary for sample insertion.

Additional Notes

How to test the change?

# Build and run the C example
bash examples/ffi/build-examples.sh 
./examples/ffi/build/profiles

# Run the benchmark
cd libdd-profiling
cargo bench --bench "main" "add_samples"

# Run profiling tests
cargo test -p "libdd-profiling-ffi" --lib

@pr-commenter
Copy link

pr-commenter bot commented Dec 14, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-12-17 19:56:15

Comparing candidate commit 0618837 in PR branch levi/profile-add2-api with baseline commit 6289fee in branch levi/profiles-dictionary-ffi.

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

scenario:benching deserializing traces from msgpack to their internal representation

  • 🟥 execution_time [+5.766ms; +6.680ms] or [+9.414%; +10.906%]

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 0618837 1766000388 levi/profile-add2-api
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.876ms 13.910ms ± 0.026ms 13.904ms ± 0.009ms 13.915ms 13.941ms 14.009ms 14.091ms 1.34% 3.306 15.182 0.19% 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 [13.906ms; 13.913ms] or [-0.026%; +0.026%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.382µs 146.457µs ± 1.645µs 146.227µs ± 0.532µs 146.772µs 148.354µs 151.484µs 161.662µs 10.56% 5.390 41.517 1.12% 0.116µ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.229µs; 146.685µs] or [-0.156%; +0.156%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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 65.824ms 67.475ms ± 2.521ms 67.319ms ± 0.302ms 67.496ms 67.830ms 86.235ms 89.087ms 32.34% 7.611 58.339 3.73% 0.178ms 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 [67.126ms; 67.825ms] or [-0.518%; +0.518%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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 88.882µs 89.346µs ± 0.208µs 89.350µs ± 0.112µs 89.448µs 89.634µs 89.723µs 90.881µs 1.71% 1.870 13.564 0.23% 0.015µ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.317µs; 89.375µs] or [-0.032%; +0.032%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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 162.321µs 163.198µs ± 0.394µs 163.160µs ± 0.144µs 163.305µs 163.621µs 164.110µs 167.119µs 2.43% 5.958 52.731 0.24% 0.028µ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 [163.144µs; 163.253µs] or [-0.033%; +0.033%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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 185.433ns 188.379ns ± 2.240ns 188.239ns ± 1.578ns 189.632ns 191.954ns 194.528ns 200.637ns 6.59% 1.359 4.029 1.19% 0.158ns 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.068ns; 188.689ns] or [-0.165%; +0.165%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.559ms 9.856ms ± 0.065ms 9.855ms ± 0.035ms 9.894ms 9.951ms 9.999ms 10.117ms 2.66% -0.675 4.266 0.66% 0.005ms 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.847ms; 9.865ms] or [-0.091%; +0.091%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.994ms 3.999ms ± 0.007ms 3.998ms ± 0.001ms 4.000ms 4.003ms 4.005ms 4.090ms 2.30% 11.416 146.648 0.17% 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.998ms; 4.000ms] or [-0.024%; +0.024%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.368ns 255.040ns ± 13.075ns 249.309ns ± 2.814ns 255.498ns 287.086ns 289.545ns 291.075ns 16.75% 1.736 1.604 5.11% 0.925ns 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.228ns; 256.852ns] or [-0.710%; +0.710%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.893µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.918µs 3.919µs 3.923µs 0.28% -0.555 8.233 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 254914382.277op/s 255593230.333op/s ± 194744.647op/s 255632414.205op/s ± 108120.699op/s 255716696.319op/s 255794760.999op/s 255891963.780op/s 256846269.469op/s 0.47% 0.578 8.361 0.08% 13770.526op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 77.179µs 79.789µs ± 1.293µs 79.793µs ± 1.080µs 80.893µs 81.788µs 82.281µs 82.663µs 3.60% -0.010 -0.900 1.62% 0.091µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12097251.533op/s 12536311.188op/s ± 203229.204op/s 12532365.169op/s ± 170121.478op/s 12700471.304op/s 12869895.025op/s 12937002.200op/s 12956948.380op/s 3.39% 0.063 -0.900 1.62% 14370.475op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.656µs 71.098µs ± 0.326µs 71.020µs ± 0.184µs 71.241µs 71.659µs 72.159µs 72.473µs 2.05% 1.305 2.150 0.46% 0.023µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13798256.957op/s 14065393.302op/s ± 64149.316op/s 14080569.082op/s ± 36292.556op/s 14107388.039op/s 14144350.390op/s 14151182.208op/s 14153169.211op/s 0.52% -1.272 2.018 0.45% 4536.042op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.891µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.914µs 3.917µs 3.918µs 3.922µs 0.25% -1.691 15.418 0.07% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254994099.833op/s 255603572.696op/s ± 181838.761op/s 255625408.521op/s ± 93054.353op/s 255708163.483op/s 255816487.317op/s 255934309.929op/s 256983297.493op/s 0.53% 1.722 15.672 0.07% 12857.942op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.423µs 67.722µs ± 0.293µs 67.593µs ± 0.121µs 67.809µs 68.310µs 68.720µs 69.010µs 2.10% 1.670 2.952 0.43% 0.021µs 1 200
credit_card/is_card_number/378282246310005 throughput 14490738.656op/s 14766429.937op/s ± 63480.476op/s 14794352.996op/s ± 26592.706op/s 14812511.771op/s 14823633.838op/s 14829468.142op/s 14831719.114op/s 0.25% -1.643 2.816 0.43% 4488.748op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 44.601µs 45.141µs ± 0.176µs 45.148µs ± 0.115µs 45.256µs 45.427µs 45.495µs 45.586µs 0.97% -0.220 0.055 0.39% 0.012µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 21936581.146op/s 22153022.240op/s ± 86360.697op/s 22149278.155op/s ± 56595.058op/s 22211416.668op/s 22299022.690op/s 22367471.145op/s 22421187.254op/s 1.23% 0.243 0.078 0.39% 6106.623op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.037µs ± 0.004µs 6.037µs ± 0.003µs 6.040µs 6.042µs 6.044µs 6.046µs 0.15% -0.156 -0.745 0.06% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 165401316.666op/s 165658845.434op/s ± 107220.894op/s 165655631.118op/s ± 87150.490op/s 165743775.572op/s 165832411.117op/s 165892583.324op/s 165926054.023op/s 0.16% 0.158 -0.745 0.06% 7581.662op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.896µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.917µs 3.922µs 3.923µs 0.26% -0.506 4.552 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254876138.370op/s 255547677.417op/s ± 200436.584op/s 255543556.240op/s ± 144260.236op/s 255693767.469op/s 255812418.046op/s 255897484.541op/s 256685286.472op/s 0.45% 0.521 4.617 0.08% 14173.007op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.597µs 65.881µs ± 0.062µs 65.882µs ± 0.031µs 65.915µs 65.971µs 66.010µs 66.036µs 0.23% -1.347 4.604 0.09% 0.004µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15143258.211op/s 15178801.834op/s ± 14355.682op/s 15178742.173op/s ± 7177.995op/s 15184622.913op/s 15198911.609op/s 15228054.657op/s 15244590.427op/s 0.43% 1.360 4.650 0.09% 1015.100op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 52.950µs 53.012µs ± 0.027µs 53.007µs ± 0.014µs 53.024µs 53.061µs 53.080µs 53.152µs 0.27% 1.349 3.972 0.05% 0.002µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18813988.091op/s 18863686.450op/s ± 9591.920op/s 18865491.243op/s ± 4905.495op/s 18869513.942op/s 18876543.441op/s 18880130.721op/s 18885873.367op/s 0.11% -1.343 3.941 0.05% 678.251op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.914µs 3.916µs 3.918µs 3.922µs 0.26% -1.036 10.090 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254957964.853op/s 255596909.577op/s ± 170701.806op/s 255614097.118op/s ± 88740.806op/s 255688787.932op/s 255815072.686op/s 255881443.305op/s 256758984.380op/s 0.45% 1.058 10.232 0.07% 12070.440op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 49.736µs 49.814µs ± 0.057µs 49.805µs ± 0.020µs 49.829µs 49.875µs 49.901µs 50.311µs 1.02% 5.643 44.408 0.11% 0.004µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 19876357.192op/s 20074636.338op/s ± 22659.632op/s 20078226.168op/s ± 8196.742op/s 20084878.597op/s 20096241.099op/s 20101657.503op/s 20106063.989op/s 0.14% -5.594 43.858 0.11% 1602.278op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 44.543µs 45.103µs ± 0.225µs 45.119µs ± 0.178µs 45.280µs 45.452µs 45.506µs 45.561µs 0.98% -0.242 -0.606 0.50% 0.016µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 21948385.899op/s 22172177.126op/s ± 110537.268op/s 22163593.016op/s ± 87084.267op/s 22256916.516op/s 22356892.856op/s 22421847.394op/s 22450321.080op/s 1.29% 0.262 -0.590 0.50% 7816.165op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.029µs 6.042µs ± 0.028µs 6.035µs ± 0.002µs 6.038µs 6.104µs 6.179µs 6.247µs 3.51% 5.094 29.713 0.46% 0.002µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 160076388.143op/s 165515295.754op/s ± 744754.032op/s 165693691.500op/s ± 60067.873op/s 165749058.132op/s 165820547.965op/s 165868112.534op/s 165874887.864op/s 0.11% -5.016 28.772 0.45% 52662.063op/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 [255566240.598op/s; 255620220.068op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [79.610µs; 79.968µs] or [-0.225%; +0.225%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12508145.575op/s; 12564476.802op/s] or [-0.225%; +0.225%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [71.053µs; 71.143µs] or [-0.064%; +0.064%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14056502.823op/s; 14074283.780op/s] or [-0.063%; +0.063%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.913µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631 throughput [255578371.593op/s; 255628773.800op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.682µs; 67.763µs] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/378282246310005 throughput [14757632.154op/s; 14775227.721op/s] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.117µs; 45.166µs] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [22141053.478op/s; 22164991.002op/s] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.036µs; 6.037µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 throughput [165643985.649op/s; 165673705.218op/s] or [-0.009%; +0.009%] 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 [255519898.834op/s; 255575455.999op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.873µs; 65.890µs] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15176812.274op/s; 15180791.393op/s] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [53.008µs; 53.016µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18862357.102op/s; 18865015.798op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255573251.948op/s; 255620567.205op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [49.806µs; 49.822µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [20071495.931op/s; 20077776.745op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.072µs; 45.134µs] or [-0.069%; +0.069%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [22156857.724op/s; 22187496.529op/s] or [-0.069%; +0.069%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.038µs; 6.046µs] or [-0.064%; +0.064%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165412080.008op/s; 165618511.500op/s] or [-0.062%; +0.062%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.200µs 3.214µs ± 1.441µs 3.009µs ± 0.025µs 3.031µs 3.663µs 13.951µs 14.941µs 396.56% 7.383 55.508 44.71% 0.102µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.014µs; 3.413µs] or [-6.212%; +6.212%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.434µs 34.062µs ± 0.945µs 33.662µs ± 0.136µs 33.831µs 36.053µs 36.093µs 37.358µs 10.98% 1.698 1.130 2.77% 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 [33.931µs; 34.193µs] or [-0.384%; +0.384%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.349µs 204.991µs ± 0.460µs 204.913µs ± 0.252µs 205.234µs 205.628µs 206.120µs 207.955µs 1.48% 2.541 12.810 0.22% 0.033µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4808742.033op/s 4878283.090op/s ± 10884.613op/s 4880125.649op/s ± 6018.284op/s 4885501.828op/s 4890929.723op/s 4893000.442op/s 4893599.912op/s 0.28% -2.485 12.370 0.22% 769.658op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.570µs 18.646µs ± 0.045µs 18.636µs ± 0.017µs 18.658µs 18.738µs 18.826µs 18.860µs 1.20% 2.048 6.013 0.24% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 53023603.592op/s 53629886.753op/s ± 127715.297op/s 53660620.677op/s ± 49015.843op/s 53698635.763op/s 53778825.087op/s 53821606.116op/s 53849780.106op/s 0.35% -2.021 5.875 0.24% 9030.835op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.692µs 10.802µs ± 0.055µs 10.800µs ± 0.039µs 10.836µs 10.898µs 10.930µs 10.980µs 1.66% 0.411 -0.168 0.51% 0.004µs 1 200
normalization/normalize_name/normalize_name/good throughput 91077999.199op/s 92579829.846op/s ± 472382.454op/s 92590779.053op/s ± 336523.919op/s 92964433.797op/s 93246296.305op/s 93437998.315op/s 93528342.325op/s 1.01% -0.386 -0.208 0.51% 33402.484op/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.927µs; 205.055µs] or [-0.031%; +0.031%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4876774.587op/s; 4879791.593op/s] or [-0.031%; +0.031%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.640µs; 18.653µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53612186.641op/s; 53647586.865op/s] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.794µs; 10.809µs] or [-0.071%; +0.071%] None None None
normalization/normalize_name/normalize_name/good throughput [92514362.181op/s; 92645297.511op/s] or [-0.071%; +0.071%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.019µs ± 0.031µs 5.014µs ± 0.029µs 5.049µs 5.066µs 5.069µs 5.084µs 1.38% 0.270 -1.427 0.62% 0.002µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.014µs; 5.023µs] or [-0.086%; +0.086%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.802µs 534.841µs ± 0.478µs 534.819µs ± 0.334µs 535.151µs 535.560µs 536.089µs 536.681µs 0.35% 0.440 0.522 0.09% 0.034µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1863303.659op/s 1869717.348op/s ± 1669.819op/s 1869792.079op/s ± 1168.224op/s 1870966.537op/s 1872321.734op/s 1873011.002op/s 1873355.442op/s 0.19% -0.434 0.508 0.09% 118.074op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 387.015µs 387.783µs ± 0.463µs 387.726µs ± 0.220µs 387.961µs 388.339µs 388.835µs 391.250µs 0.91% 3.674 23.415 0.12% 0.033µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2555910.246op/s 2578764.250op/s ± 3065.772op/s 2579143.812op/s ± 1462.976op/s 2580482.765op/s 2582044.160op/s 2583006.041op/s 2583877.964op/s 0.18% -3.632 23.019 0.12% 216.783op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.924µs 190.256µs ± 0.207µs 190.217µs ± 0.111µs 190.354µs 190.689µs 190.877µs 191.168µs 0.50% 1.438 2.797 0.11% 0.015µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5230996.795op/s 5256084.043op/s ± 5696.483op/s 5257147.648op/s ± 3079.121op/s 5259943.899op/s 5262935.907op/s 5264236.936op/s 5265273.241op/s 0.15% -1.430 2.761 0.11% 402.802op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.400µs 37.530µs ± 0.051µs 37.532µs ± 0.039µs 37.571µs 37.616µs 37.636µs 37.647µs 0.30% -0.013 -0.464 0.14% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26562638.678op/s 26645378.426op/s ± 36082.479op/s 26643626.577op/s ± 27762.166op/s 26672338.667op/s 26698663.923op/s 26734974.751op/s 26737916.543op/s 0.35% 0.019 -0.461 0.14% 2551.417op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.812µs 45.924µs ± 0.092µs 45.907µs ± 0.030µs 45.948µs 46.015µs 46.129µs 46.766µs 1.87% 6.228 50.598 0.20% 0.006µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21382863.013op/s 21775311.175op/s ± 42983.824op/s 21783230.954op/s ± 14207.629op/s 21795295.437op/s 21807734.460op/s 21818023.851op/s 21828336.625op/s 0.21% -6.146 49.614 0.20% 3039.415op/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.774µs; 534.907µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1869485.927op/s; 1869948.769op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [387.719µs; 387.847µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2578339.363op/s; 2579189.136op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.227µs; 190.285µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5255294.565op/s; 5256873.521op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.523µs; 37.537µs] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26640377.742op/s; 26650379.111op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.911µs; 45.936µs] or [-0.028%; +0.028%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21769354.030op/s; 21781268.320op/s] or [-0.027%; +0.027%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.412µs 2.437µs ± 0.010µs 2.437µs ± 0.008µs 2.444µs 2.455µs 2.461µs 2.469µs 1.30% 0.293 0.086 0.41% 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.436µs; 2.439µs] or [-0.057%; +0.057%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.729ms 10.753ms ± 0.014ms 10.751ms ± 0.008ms 10.760ms 10.774ms 10.791ms 10.831ms 0.74% 1.388 4.766 0.13% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.751ms; 10.755ms] or [-0.018%; +0.018%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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 536.824µs 537.609µs ± 0.371µs 537.540µs ± 0.198µs 537.806µs 538.299µs 538.709µs 538.869µs 0.25% 0.748 0.823 0.07% 0.026µ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 [537.558µs; 537.660µs] or [-0.010%; +0.010%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0618837 1766000388 levi/profile-add2-api
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.030µs 25.331µs ± 9.377µs 18.277µs ± 0.160µs 33.975µs 43.683µs 45.808µs 67.895µs 271.48% 1.096 0.954 36.93% 0.663µ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.032µs; 26.631µs] or [-5.130%; +5.130%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2025

Codecov Report

❌ Patch coverage is 0% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.67%. Comparing base (6289fee) to head (0618837).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           levi/profiles-dictionary-ffi    #1406      +/-   ##
================================================================
- Coverage                         71.73%   71.67%   -0.07%     
================================================================
  Files                               411      411              
  Lines                             66018    66069      +51     
================================================================
- Hits                              47360    47354       -6     
- Misses                            18658    18715      +57     
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.61% <ø> (-0.11%) ⬇️
libdd-profiling 82.33% <0.00%> (-0.42%) ⬇️
libdd-profiling-ffi 70.97% <0.00%> (-1.58%) ⬇️
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 15, 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.50 MB +.83% (+64.00 KB) 🔍
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 86.48 MB 87.05 MB +.66% (+586.01 KB) 🔍
aarch64-apple-darwin
Artifact Baseline Commit Change
/aarch64-apple-darwin/lib/libdatadog_profiling.a 58.49 MB 58.94 MB +.77% (+466.60 KB) 🔍
/aarch64-apple-darwin/lib/libdatadog_profiling.dylib 8.45 MB 8.51 MB +.69% (+60.35 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.61 MB 9.62 MB +.15% (+14.93 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.27 MB 100.86 MB +.58% (+602.59 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 19.72 MB 20.06 MB +1.75% (+354.00 KB) ⚠️
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 69.82 KB 74.31 KB +6.43% (+4.49 KB) 🚨
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 140.15 MB 142.02 MB +1.33% (+1.87 MB) ⚠️
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 744.89 MB 748.16 MB +.43% (+3.27 MB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 6.37 MB 6.42 MB +.71% (+47.00 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 69.82 KB 74.31 KB +6.43% (+4.49 KB) 🚨
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 19.75 MB 19.94 MB +.94% (+192.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 38.79 MB 39.06 MB +.70% (+281.58 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 16.83 MB 17.12 MB +1.72% (+296.50 KB) ⚠️
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 70.90 KB 75.46 KB +6.43% (+4.56 KB) 🚨
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 142.76 MB 144.69 MB +1.35% (+1.92 MB) ⚠️
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 733.41 MB 736.75 MB +.45% (+3.34 MB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.89 MB 4.93 MB +.79% (+40.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 70.90 KB 75.46 KB +6.43% (+4.56 KB) 🚨
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 20.98 MB 21.19 MB +1.00% (+216.00 KB) ⚠️
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 36.54 MB 36.82 MB +.75% (+280.93 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 74.80 MB 75.34 MB +.71% (+551.53 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.88 MB 8.93 MB +.52% (+48.00 KB) 🔍
x86_64-apple-darwin
Artifact Baseline Commit Change
/x86_64-apple-darwin/lib/libdatadog_profiling.a 59.83 MB 60.29 MB +.76% (+469.68 KB) 🔍
/x86_64-apple-darwin/lib/libdatadog_profiling.dylib 9.50 MB 9.55 MB +.53% (+51.78 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.46 MB 95.01 MB +.58% (+561.74 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.32 MB 10.37 MB +.48% (+50.81 KB) 🔍

@morrisonlevi morrisonlevi force-pushed the levi/profiles-dictionary-ffi branch from 7e79afb to 6289fee Compare December 17, 2025 19:37
// Create a ProfilesDictionary for the new API
ddog_prof_ProfilesDictionaryHandle dict = {0};
ddog_prof_Status dict_status = ddog_prof_ProfilesDictionary_new(&dict);
if (dict_status.flags != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be a named constant to be clearer

Copy link
Contributor

Choose a reason for hiding this comment

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

Or a helper function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You specifically mean the 0 for the name? It was chosen specifically because environments like Java and sometimes .NET don't get to use the C macros--the detail needs to be concrete.

But we can still add a constant, it just needs to be guaranteed to also be zero or else there could be issues.

To be honest, we could probably simplify this stuff. Rely on null to mean no error, and then use the lowest bit for "allocated or not".

@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 20:22:39 UTC ℹ️ Start processing command /merge


2025-12-17 20:22:45 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in levi/profiles-dictionary-ffi is approximately 0s (p90).


2025-12-17 20:23:52 UTC ℹ️ MergeQueue: Retrying because an high priority merge request needed to be processed first. No action is needed from your side.


2025-12-17 20:23:55 UTC ⚠️ MergeQueue: This merge request build was cancelled

levi.morrison@datadoghq.com cancelled this merge request build

@morrisonlevi
Copy link
Contributor Author

/merge --cancel

@dd-devflow-routing-codex
Copy link

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

View all feedbacks in Devflow UI.

2025-12-17 20:23:46 UTC ℹ️ Start processing command /merge --cancel

Base automatically changed from levi/profiles-dictionary-ffi to main December 17, 2025 20:29
@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 20:39:03 UTC ℹ️ Start processing command /merge


2025-12-17 20:39:08 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-12-17 21:02:41 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 379c66e into main Dec 17, 2025
37 of 38 checks passed
@dd-mergequeue dd-mergequeue bot deleted the levi/profile-add2-api branch December 17, 2025 21:02
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