Skip to content

feat(profiling): upload compression config #1064

New issue

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

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

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morrisonlevi
Copy link
Contributor

@morrisonlevi morrisonlevi commented May 19, 2025

What does this PR do?

Adds upload compression configuration. For now, the options are Off,
On, and Lz4:

  • Off: no compression.
  • On: default, and which algorithm it chooses can change.
  • Lz4: lz4 frame encoded. Currently what On uses.

Also adds some conversions between FFI Result types and
std::result::Result and exposes some more public members, so that
they can be used in examples.

Motivation

This is being done in preparation for having Zstd as an option, and
possibly the new default.

Additional Notes

We may want roundtrip_to_pprof to be configurable on what
compression algorithm it uses. None would speed up tests,
but once we have zstd, we may wish to test each one.

How to test the change?

There's nothing to change unless you want to test out the different
compression algorithms. In that case, call
ddog_prof_Profile_set_upload_compression before uploading.

@morrisonlevi morrisonlevi requested a review from a team as a code owner May 19, 2025 18:18
@morrisonlevi morrisonlevi added profiling Relates to the profiling* modules. breaking-change labels May 19, 2025
@morrisonlevi morrisonlevi requested a review from a team as a code owner May 19, 2025 18:22
@pr-commenter
Copy link

pr-commenter bot commented May 19, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-05-29 18:00:47

Comparing candidate commit 35933df in PR branch PROF-11830-Add-upload-compression-configuration-to-libdatadog with baseline commit 8b4ff00 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 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 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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.964µs 5.028µs ± 0.040µs 5.025µs ± 0.036µs 5.070µs 5.087µs 5.091µs 5.142µs 2.32% 0.324 -1.228 0.79% 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.022µs; 5.033µs] or [-0.110%; +0.110%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 437.478µs 438.318µs ± 0.581µs 438.200µs ± 0.278µs 438.552µs 439.041µs 441.143µs 441.459µs 0.74% 2.658 10.472 0.13% 0.041µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 2265215.509op/s 2281452.527op/s ± 3012.681op/s 2282061.683op/s ± 1449.073op/s 2283269.165op/s 2284519.417op/s 2285268.312op/s 2285831.582op/s 0.17% -2.637 10.336 0.13% 213.029op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 452.801µs 453.605µs ± 0.378µs 453.576µs ± 0.232µs 453.816µs 454.349µs 454.521µs 454.682µs 0.24% 0.435 0.104 0.08% 0.027µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2199339.077op/s 2204561.859op/s ± 1836.655op/s 2204701.095op/s ± 1127.195op/s 2205797.547op/s 2207325.948op/s 2208379.372op/s 2208476.420op/s 0.17% -0.430 0.099 0.08% 129.871op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 178.533µs 179.134µs ± 0.349µs 179.048µs ± 0.259µs 179.411µs 179.741µs 179.851µs 179.893µs 0.47% 0.445 -0.968 0.19% 0.025µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5558854.839op/s 5582429.184op/s ± 10868.366op/s 5585080.025op/s ± 8072.169op/s 5591201.315op/s 5596815.897op/s 5598672.715op/s 5601191.187op/s 0.29% -0.440 -0.973 0.19% 768.510op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 38.955µs 39.053µs ± 0.055µs 39.042µs ± 0.030µs 39.082µs 39.159µs 39.224µs 39.320µs 0.71% 1.294 2.917 0.14% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 25432190.108op/s 25606336.844op/s ± 36001.512op/s 25613381.610op/s ± 20009.920op/s 25630269.879op/s 25650810.092op/s 25667722.269op/s 25670365.363op/s 0.22% -1.281 2.856 0.14% 2545.691op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 46.964µs 47.092µs ± 0.056µs 47.086µs ± 0.034µs 47.121µs 47.191µs 47.239µs 47.336µs 0.53% 0.715 1.333 0.12% 0.004µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21125400.608op/s 21235147.182op/s ± 25197.622op/s 21237943.573op/s ± 15220.551op/s 21252820.258op/s 21272226.190op/s 21280962.435op/s 21293057.977op/s 0.26% -0.705 1.302 0.12% 1781.741op/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 [438.238µs; 438.399µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [2281034.998op/s; 2281870.055op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [453.553µs; 453.658µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2204307.316op/s; 2204816.401op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [179.086µs; 179.183µs] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5580922.933op/s; 5583935.435op/s] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [39.045µs; 39.061µs] or [-0.020%; +0.020%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [25601347.381op/s; 25611326.307op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [47.084µs; 47.100µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21231655.034op/s; 21238639.330op/s] or [-0.016%; +0.016%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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.889µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.917µs 3.920µs 3.920µs 0.23% -1.171 11.371 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 255087031.746op/s 255663937.039op/s ± 211001.076op/s 255684660.651op/s ± 121101.393op/s 255791021.752op/s 255898437.741op/s 255966682.182op/s 257157586.330op/s 0.58% 1.201 11.592 0.08% 14920.029op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 76.767µs 77.543µs ± 0.406µs 77.526µs ± 0.296µs 77.789µs 78.284µs 78.485µs 78.685µs 1.50% 0.436 -0.497 0.52% 0.029µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12708934.890op/s 12896382.620op/s ± 67318.416op/s 12898957.967op/s ± 49176.645op/s 12951523.419op/s 12992729.918op/s 13010105.197op/s 13026400.606op/s 0.99% -0.416 -0.522 0.52% 4760.131op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.800µs 71.355µs ± 0.238µs 71.319µs ± 0.145µs 71.488µs 71.809µs 71.975µs 72.114µs 1.12% 0.686 0.373 0.33% 0.017µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13866881.089op/s 14014570.503op/s ± 46672.810op/s 14021605.903op/s ± 28570.934op/s 14048955.928op/s 14074137.088op/s 14114266.746op/s 14124306.519op/s 0.73% -0.667 0.347 0.33% 3300.266op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.890µs 3.912µs ± 0.003µs 3.911µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.921µs 0.25% -0.955 7.404 0.09% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255039600.459op/s 255647125.644op/s ± 219633.832op/s 255671147.528op/s ± 141904.913op/s 255782726.530op/s 255932685.040op/s 256027829.299op/s 257060776.929op/s 0.54% 0.977 7.548 0.09% 15530.457op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.090µs 67.876µs ± 0.401µs 67.824µs ± 0.259µs 68.096µs 68.575µs 69.082µs 69.623µs 2.65% 0.864 1.649 0.59% 0.028µs 1 200
credit_card/is_card_number/378282246310005 throughput 14363146.340op/s 14733298.805op/s ± 86638.424op/s 14744135.944op/s ± 56359.882op/s 14799092.451op/s 14849850.928op/s 14897010.032op/s 14905253.447op/s 1.09% -0.814 1.482 0.59% 6126.262op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.742µs 51.801µs ± 0.034µs 51.798µs ± 0.025µs 51.823µs 51.867µs 51.885µs 51.900µs 0.20% 0.561 -0.239 0.07% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19267711.745op/s 19304722.232op/s ± 12659.469op/s 19305862.683op/s ± 9398.825op/s 19315448.075op/s 19321464.911op/s 19325301.410op/s 19326726.582op/s 0.11% -0.558 -0.244 0.07% 895.160op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.029µs 6.229µs ± 0.063µs 6.230µs ± 0.044µs 6.271µs 6.316µs 6.380µs 6.401µs 2.75% -0.038 -0.019 1.00% 0.004µs 1 200
credit_card/is_card_number/x371413321323331 throughput 156221816.279op/s 160543408.600op/s ± 1616526.623op/s 160524583.135op/s ± 1124886.451op/s 161666206.102op/s 163069491.600op/s 163770328.718op/s 165851282.892op/s 3.32% 0.098 0.002 1.00% 114305.694op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.890µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.915µs 3.918µs 3.918µs 0.18% -1.649 12.685 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255200776.242op/s 255682907.985op/s ± 186452.015op/s 255664718.270op/s ± 129310.509op/s 255812595.936op/s 255911966.772op/s 255973301.686op/s 257045685.573op/s 0.54% 1.675 12.903 0.07% 13184.148op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.988µs 66.237µs ± 0.146µs 66.212µs ± 0.086µs 66.316µs 66.494µs 66.711µs 66.923µs 1.07% 1.221 2.809 0.22% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 14942542.954op/s 15097424.131op/s ± 33145.908op/s 15103041.754op/s ± 19693.697op/s 15121939.666op/s 15142417.015op/s 15151107.885op/s 15154192.909op/s 0.34% -1.200 2.715 0.22% 2343.770op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 59.384µs 59.556µs ± 0.073µs 59.554µs ± 0.048µs 59.607µs 59.663µs 59.726µs 59.888µs 0.56% 0.522 1.722 0.12% 0.005µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16697880.771op/s 16790948.177op/s ± 20491.007op/s 16791532.870op/s ± 13582.538op/s 16803387.983op/s 16821663.359op/s 16836888.870op/s 16839628.698op/s 0.29% -0.509 1.682 0.12% 1448.933op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.893µs 3.911µs ± 0.003µs 3.910µs ± 0.002µs 3.912µs 3.914µs 3.916µs 3.917µs 0.18% -1.250 9.379 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255276394.351op/s 255710836.356op/s ± 166579.101op/s 255723309.180op/s ± 117300.820op/s 255833845.885op/s 255911635.090op/s 255944667.746op/s 256850407.289op/s 0.44% 1.269 9.526 0.06% 11778.921op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 56.161µs 56.264µs ± 0.076µs 56.248µs ± 0.039µs 56.299µs 56.381µs 56.482µs 56.823µs 1.02% 2.545 13.789 0.14% 0.005µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17598358.014op/s 17773396.656op/s ± 24005.534op/s 17778322.003op/s ± 12357.460op/s 17788162.423op/s 17801987.770op/s 17805048.889op/s 17805806.473op/s 0.15% -2.507 13.432 0.13% 1697.448op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.739µs 51.800µs ± 0.038µs 51.799µs ± 0.025µs 51.818µs 51.868µs 51.914µs 51.980µs 0.35% 1.128 2.427 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19238229.575op/s 19305119.013op/s ± 14052.498op/s 19305527.436op/s ± 9213.800op/s 19315875.500op/s 19323257.105op/s 19326605.303op/s 19327889.577op/s 0.12% -1.121 2.396 0.07% 993.662op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.073µs 6.223µs ± 0.066µs 6.227µs ± 0.043µs 6.267µs 6.334µs 6.351µs 6.414µs 3.02% 0.009 -0.413 1.05% 0.005µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 155897818.450op/s 160705226.308op/s ± 1694682.651op/s 160601588.934op/s ± 1114285.528op/s 161787059.349op/s 163593819.285op/s 164116162.448op/s 164669531.335op/s 2.53% 0.041 -0.430 1.05% 119832.159op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.911µs; 3.912µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255634694.319op/s; 255693179.759op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [77.487µs; 77.599µs] or [-0.073%; +0.073%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12887052.935op/s; 12905712.305op/s] or [-0.072%; +0.072%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [71.322µs; 71.388µs] or [-0.046%; +0.046%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14008102.101op/s; 14021038.906op/s] or [-0.046%; +0.046%] None None None
credit_card/is_card_number/37828224631 execution_time [3.911µs; 3.912µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/37828224631 throughput [255616686.507op/s; 255677564.781op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.820µs; 67.931µs] or [-0.082%; +0.082%] None None None
credit_card/is_card_number/378282246310005 throughput [14721291.552op/s; 14745306.057op/s] or [-0.081%; +0.081%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [51.796µs; 51.806µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19302967.751op/s; 19306476.712op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.221µs; 6.238µs] or [-0.139%; +0.139%] None None None
credit_card/is_card_number/x371413321323331 throughput [160319373.557op/s; 160767443.642op/s] or [-0.140%; +0.140%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.911µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255657067.529op/s; 255708748.441op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [66.217µs; 66.257µs] or [-0.031%; +0.031%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15092830.427op/s; 15102017.835op/s] or [-0.030%; +0.030%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [59.546µs; 59.566µs] or [-0.017%; +0.017%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [16788108.321op/s; 16793788.034op/s] or [-0.017%; +0.017%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.910µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255687750.095op/s; 255733922.617op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [56.253µs; 56.275µs] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [17770069.720op/s; 17776723.592op/s] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [51.795µs; 51.805µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19303171.471op/s; 19307066.554op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.214µs; 6.232µs] or [-0.146%; +0.146%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [160470359.592op/s; 160940093.025op/s] or [-0.146%; +0.146%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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.314µs 2.372µs ± 0.015µs 2.373µs ± 0.007µs 2.380µs 2.397µs 2.404µs 2.411µs 1.61% -1.180 3.691 0.65% 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.370µs; 2.374µs] or [-0.090%; +0.090%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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.176µs 26.264µs ± 10.612µs 18.549µs ± 0.296µs 35.046µs 45.222µs 46.564µs 91.566µs 393.65% 1.677 5.738 40.30% 0.750µ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.794µs; 27.735µs] or [-5.600%; +5.600%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 218.118µs 218.611µs ± 0.283µs 218.622µs ± 0.224µs 218.818µs 219.090µs 219.258µs 219.379µs 0.35% 0.242 -0.772 0.13% 0.020µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4558313.132op/s 4574353.153op/s ± 5929.696op/s 4574112.550op/s ± 4678.862op/s 4579562.773op/s 4582926.968op/s 4584386.814op/s 4584680.957op/s 0.23% -0.237 -0.778 0.13% 419.293op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.578µs 17.664µs ± 0.048µs 17.659µs ± 0.027µs 17.686µs 17.749µs 17.777µs 17.983µs 1.83% 1.915 8.969 0.27% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 55609001.985op/s 56611348.448op/s ± 152960.385op/s 56629336.926op/s ± 85957.140op/s 56714460.418op/s 56795540.802op/s 56856037.518op/s 56887918.002op/s 0.46% -1.856 8.509 0.27% 10815.933op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.306µs 10.339µs ± 0.019µs 10.335µs ± 0.011µs 10.350µs 10.372µs 10.405µs 10.406µs 0.69% 1.006 1.173 0.18% 0.001µs 1 200
normalization/normalize_name/normalize_name/good throughput 96096148.965op/s 96719395.249op/s ± 175722.477op/s 96757622.577op/s ± 104018.328op/s 96843457.729op/s 96941108.429op/s 97009210.487op/s 97028771.623op/s 0.28% -0.994 1.135 0.18% 12425.455op/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 [218.571µs; 218.650µs] or [-0.018%; +0.018%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4573531.354op/s; 4575174.952op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.658µs; 17.671µs] or [-0.038%; +0.038%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [56590149.609op/s; 56632547.286op/s] or [-0.037%; +0.037%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.337µs; 10.342µs] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/good throughput [96695041.803op/s; 96743748.694op/s] or [-0.025%; +0.025%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 73.184ms 73.503ms ± 0.180ms 73.494ms ± 0.123ms 73.597ms 73.831ms 74.027ms 74.155ms 0.90% 0.901 0.935 0.24% 0.013ms 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 [73.478ms; 73.528ms] or [-0.034%; +0.034%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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.184µs 3.183µs ± 1.437µs 2.985µs ± 0.026µs 3.007µs 3.641µs 13.888µs 14.878µs 398.49% 7.413 55.886 45.02% 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 [2.984µs; 3.383µs] or [-6.255%; +6.255%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 31.450µs 32.413µs ± 1.307µs 31.624µs ± 0.101µs 34.017µs 34.583µs 34.830µs 34.923µs 10.43% 0.932 -1.062 4.02% 0.092µ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 [32.232µs; 32.595µs] or [-0.559%; +0.559%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 65.775µs 65.946µs ± 0.223µs 65.907µs ± 0.037µs 65.957µs 66.098µs 66.600µs 68.442µs 3.85% 8.280 82.883 0.34% 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 [65.915µs; 65.977µs] or [-0.047%; +0.047%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 246.971ns 254.076ns ± 10.186ns 250.026ns ± 2.039ns 254.818ns 284.364ns 291.175ns 292.200ns 16.87% 2.469 5.371 4.00% 0.720ns 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 [252.665ns; 255.488ns] or [-0.556%; +0.556%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 145.836µs 146.506µs ± 0.339µs 146.424µs ± 0.169µs 146.646µs 147.168µs 147.570µs 147.970µs 1.06% 1.557 3.002 0.23% 0.024µ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 [146.458µs; 146.553µs] or [-0.032%; +0.032%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 35933df 1748540890 PROF-11830-Add-upload-compression-configuration-to-libdatadog
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 5.928ms 5.942ms ± 0.006ms 5.942ms ± 0.004ms 5.946ms 5.952ms 5.959ms 5.964ms 0.37% 0.627 0.930 0.10% 0.000ms 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 [5.942ms; 5.943ms] or [-0.014%; +0.014%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2025

Codecov Report

Attention: Patch coverage is 73.68421% with 15 lines in your changes missing coverage. Please review.

Project coverage is 70.92%. Comparing base (8b4ff00) to head (35933df).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1064      +/-   ##
==========================================
+ Coverage   70.91%   70.92%   +0.01%     
==========================================
  Files         329      329              
  Lines       49877    49916      +39     
==========================================
+ Hits        35369    35403      +34     
- Misses      14508    14513       +5     
Components Coverage Δ
datadog-crashtracker 42.55% <ø> (ø)
datadog-crashtracker-ffi 6.03% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.61% <ø> (ø)
data-pipeline-ffi 89.26% <ø> (ø)
ddcommon 79.93% <0.00%> (-0.15%) ⬇️
ddcommon-ffi 68.34% <0.00%> (-0.31%) ⬇️
ddtelemetry 60.56% <ø> (ø)
ddtelemetry-ffi 21.32% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.68% <ø> (+0.10%) ⬆️
datadog-profiling 77.21% <80.76%> (+0.03%) ⬆️
datadog-profiling-ffi 62.71% <86.48%> (+0.59%) ⬆️
datadog-sidecar 41.40% <ø> (ø)
datdog-sidecar-ffi 3.21% <ø> (ø)
spawn-worker 55.35% <ø> (ø)
tinybytes 90.96% <ø> (ø)
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.16% <ø> (ø)
datadog-trace-protobuf 77.10% <ø> (ø)
datadog-trace-utils 89.44% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@r1viollet
Copy link
Contributor

r1viollet commented May 19, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 66.02 MB 66.00 MB --.03% (-24.52 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.03 MB 7.96 MB --.82% (-68.00 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 20.31 MB 20.30 MB --.01% (-4.15 KB) 💪
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.00 MB 7.93 MB --.82% (-68.00 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 22.70 MB 22.68 MB --.07% (-17.58 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 72.62 MB 72.56 MB --.08% (-63.10 KB) 💪
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 16.71 MB 16.69 MB --.08% (-14.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 62.31 KB 62.31 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 112.66 MB 112.53 MB --.11% (-136.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 631.82 MB 631.29 MB --.08% (-550.74 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 4.99 MB 4.99 MB --.04% (-2.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 62.31 KB 62.31 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 15.88 MB 15.87 MB --.04% (-8.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 26.43 MB 26.40 MB --.09% (-26.26 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 14.15 MB 14.14 MB --.08% (-12.00 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 63.26 KB 63.26 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 114.51 MB 114.40 MB --.10% (-120.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 624.40 MB 624.27 MB --.02% (-133.58 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 3.78 MB 3.78 MB --.06% (-2.50 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 63.26 KB 63.26 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 16.50 MB 16.48 MB --.09% (-16.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 24.34 MB 24.32 MB --.10% (-24.93 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 57.50 MB 57.48 MB --.03% (-21.75 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.43 MB 8.42 MB --.12% (-10.38 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 18.71 MB 18.70 MB --.01% (-2.93 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 68.61 MB 68.58 MB --.04% (-31.02 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.43 MB 8.42 MB --.12% (-10.38 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 20.90 MB 20.89 MB --.03% (-7.70 KB) 💪

@morrisonlevi morrisonlevi enabled auto-merge (squash) May 19, 2025 21:16
@felixge
Copy link
Member

felixge commented May 20, 2025

Update ddog_prof_Profile_serialize to pass a UploadCompression.
You probably want DDOG_PROF_UPLOAD_COMPRESSION_ON when
migrating.

What kind of env var is this? Did you mean DD_PROFILING_UPLOAD_COMPRESSION=on?

@ivoanjo
Copy link
Member

ivoanjo commented May 20, 2025

I wonder if for this feature it's worth implementing it in a slightly different way. E.g. the current approach of exposing the compression as a flag means:

  1. Breaking API change, everyone will need to change to support this
  2. Everyone will need to parse DD_PROFILING_UPLOAD_COMPRESSION, and when new values get added there (e.g. things such as "zstd-2"), everyone needs to update their string-to-enum-entry code again
  3. We're considering that this feature may not live forever, and thus we'd need another breaking change if/when we remove it.

As an alternative, it would be really cool if libdatadog just looked at DD_PROFILING_UPLOAD_COMPRESSION directly and did the right thing automatically. This would mean that all libraries would instantly gain this feature with the upgrade, and as we added or removed options those would be automatically supported.

This means a bit less control for the libdatadog callers but... again in this case may be worth having the exception?

@r1viollet
Copy link
Contributor

r1viollet commented May 20, 2025

Update ddog_prof_Profile_serialize to pass a UploadCompression.
You probably want DDOG_PROF_UPLOAD_COMPRESSION_ON when
migrating.

What kind of env var is this? Did you mean DD_PROFILING_UPLOAD_COMPRESSION=on?

Aligning on env vars is a good idea, @felixge proposed a convention (you can refer to internal notebook)

@r1viollet
Copy link
Contributor

...

This means a bit less control for the libdatadog callers but... again in this case may be worth having the exception?

Though do you want libdatadog APIs calling getenv ? Or would you document this as being part of the init process?
These are minor thread safety concerns, feel free to consider both approaches. I can see the testing requirements and API stability requirements as valid.

@ivoanjo
Copy link
Member

ivoanjo commented May 20, 2025

Though do you want libdatadog APIs calling getenv ? Or would you document this as being part of the init process?

In general no, but I think this particular situation warrants doing that.

@morrisonlevi
Copy link
Contributor Author

morrisonlevi commented May 20, 2025

Runtimes need to manage the env var, partly because calling getenv in the wrong place can cause crashes. It's also partly because PHP has INI settings, and getenv obviously won't integrate with those.

Regarding DDOG_PROF_UPLOAD_COMPRESSION_ON, it is not an env var, but rather an enum value generated by the API.

I can make a parsing function like fn parse(value: &str) -> Option<UploadCompression> or similar, and FFI it. That way libraries don't have to updating parsing code as things change, but they will still have to manage the env var/INI settings.

@ivoanjo
Copy link
Member

ivoanjo commented May 20, 2025

It's also partly because PHP has INI settings, and getenv obviously won't integrate with those.

I'm with you -- Ruby also has a config-via-code that usually we try to respect.

What I'm suggesting is -- in this case, I don't think it's worth respecting it? Since this is supposed to be for internal testing anyway, so it seems reasonable to say it can only be set via env flag.

@morrisonlevi morrisonlevi marked this pull request as draft May 20, 2025 15:56
auto-merge was automatically disabled May 20, 2025 15:56

Pull request was converted to draft

@danielsn
Copy link
Contributor

Proposal: we have a flag on the profiler object that defaults to on, with an API function to set it. Then the API still works the same way by default, but each language can override as it wishes.

@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from 5ea6e93 to d301705 Compare May 25, 2025 19:19
@morrisonlevi morrisonlevi changed the base branch from main to levi/datadog-profiling-protobuf May 25, 2025 19:19
@morrisonlevi morrisonlevi changed the title feat(profiling)!: Add upload compression config feat(profiling): upload compression config May 25, 2025
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from d301705 to 8fa167e Compare May 25, 2025 19:25
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from 714ecc0 to 5d54a41 Compare May 27, 2025 16:32
@morrisonlevi morrisonlevi force-pushed the levi/datadog-profiling-protobuf branch from fc0bfe1 to 68be8ec Compare May 27, 2025 16:40
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from 5d54a41 to 9cafb27 Compare May 27, 2025 16:42
@morrisonlevi morrisonlevi force-pushed the levi/datadog-profiling-protobuf branch from 68be8ec to 623bb6e Compare May 28, 2025 21:17
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch 2 times, most recently from c4c8301 to 49d50fa Compare May 28, 2025 21:23
@morrisonlevi morrisonlevi force-pushed the levi/datadog-profiling-protobuf branch from 623bb6e to 3634bc9 Compare May 28, 2025 21:23
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from 49d50fa to 9fa834b Compare May 29, 2025 02:32
Base automatically changed from levi/datadog-profiling-protobuf to main May 29, 2025 17:43
@morrisonlevi morrisonlevi force-pushed the PROF-11830-Add-upload-compression-configuration-to-libdatadog branch from 9fa834b to 35933df Compare May 29, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common profiling Relates to the profiling* modules.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants