Skip to content

Add functions to SendDataBuilder #1140

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

lym953
Copy link

@lym953 lym953 commented Jul 10, 2025

What does this PR do?

Add functions to SendDataBuilder:

  • with_api_key()
  • with_retry_strategy()
  • len()
  • is_empty()

Motivation

DataDog/datadog-lambda-extension#732 We want to lazily set api key in the target, i.e. leave it empty at creation time then set it later.
As a result, we need to pass SendDataBuilder around in the codebase, instead of passing SendData. Wherever we need to set/get data on SendData right now, we need to do them on SendDataBuilder instead.

How to test the change?

Using the added test

@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.38%. Comparing base (ca19adc) to head (dbc4779).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1140      +/-   ##
==========================================
+ Coverage   71.30%   71.38%   +0.08%     
==========================================
  Files         343      343              
  Lines       52471    52547      +76     
==========================================
+ Hits        37412    37511      +99     
+ Misses      15059    15036      -23     
Components Coverage Δ
datadog-crashtracker 43.94% <ø> (ø)
datadog-crashtracker-ffi 5.93% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 89.27% <ø> (+0.04%) ⬆️
data-pipeline-ffi 87.67% <ø> (+0.06%) ⬆️
ddcommon 82.88% <ø> (ø)
ddcommon-ffi 69.66% <ø> (ø)
ddtelemetry 60.08% <ø> (ø)
ddtelemetry-ffi 21.32% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.58% <ø> (ø)
datadog-profiling 77.13% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 40.28% <ø> (ø)
datdog-sidecar-ffi 5.17% <ø> (ø)
spawn-worker 55.35% <ø> (ø)
tinybytes 90.96% <ø> (ø)
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf 77.10% <ø> (ø)
datadog-trace-utils 89.52% <100.00%> (+0.35%) ⬆️
datadog-tracer-flare 78.54% <ø> (ø)
datadog-log 76.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lym953 lym953 marked this pull request as ready for review July 11, 2025 16:04
@lym953 lym953 requested review from a team as code owners July 11, 2025 16:04
@lym953 lym953 requested a review from a team July 11, 2025 16:05
/// # Returns
///
/// A mutable reference to the target endpoint.
pub fn get_target_mut(&mut self) -> &mut Endpoint {
Copy link
Contributor

Choose a reason for hiding this comment

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

You really shouldn't be changing the target for the SendData object. This was just discussed with @shreyamalpani for #1134 and #1139

Copy link
Author

Choose a reason for hiding this comment

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

Could you elaborate why? I don't see enough discussion in those two PRs.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

The send_with_retry module uses the endpoint. It's creates inconsistent behavior if the endpoint changes between retries.

The coalesce_send_data function sorts and deduplicates SendData based on endpoint properties. Changing the endpoints can lead to invalid deduplication and/or merged payloads being sent to the wrong destination.

send_data also has async code that uses the endpoint. Changing them can cause unexpected behavior and race conditions.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the context! Will it still be a concern if we only expose set_api_key()? From a quick look at your code pointers, I see url, timeout_ms and test_token used, but not api_key.

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the API key wouldn't impact the coalesce_send_data function, but it would impact send_with_retry which calls to_request_builder() which uses the api key. Changing just the API key can cause another issue; I don't think it's a particularly good design, but send_data determines whether to serialize to msgpack or proto based on the presence of an API key. If that switches from None to Some while the url remains the same it can lead to runtime errors.

If you need to lazily add the api key, I'd suggest adding a with_api_key() function to SendDataBuilder.

Copy link
Author

Choose a reason for hiding this comment

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

Sure! I limited all the changes to SendDataBuilder. Could you take a look?

@lym953 lym953 changed the title Add SendData.get_target_mut() Add SendData.set_api_key() Jul 14, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jul 14, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-07-15 20:16:46

Comparing candidate commit dbc4779 in PR branch yiming.luo/send-data-get-mut-target with baseline commit a9d660b 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 dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.796µs 25.981µs ± 10.227µs 18.050µs ± 0.215µs 34.596µs 43.372µs 52.745µs 76.352µs 323.00% 1.245 2.351 39.27% 0.723µ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.564µs; 27.399µs] or [-5.455%; +5.455%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 86.394µs 86.640µs ± 0.166µs 86.620µs ± 0.055µs 86.683µs 86.814µs 86.923µs 88.379µs 2.03% 6.534 61.829 0.19% 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 [86.617µs; 86.663µs] or [-0.027%; +0.027%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.996µs 5.077µs ± 0.056µs 5.070µs ± 0.047µs 5.104µs 5.183µs 5.189µs 5.193µs 2.43% 0.567 -0.772 1.10% 0.004µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.069µs; 5.084µs] or [-0.153%; +0.153%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.432µs 2.457µs ± 0.024µs 2.454µs ± 0.015µs 2.467µs 2.527µs 2.533µs 2.534µs 3.28% 1.697 2.986 0.97% 0.002µ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.454µs; 2.461µs] or [-0.135%; +0.135%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.940µs 34.365µs ± 0.716µs 34.056µs ± 0.073µs 34.144µs 35.789µs 35.859µs 38.254µs 12.33% 2.059 4.103 2.08% 0.051µ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.266µs; 34.465µs] or [-0.289%; +0.289%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 243.930ns 254.813ns ± 13.870ns 247.828ns ± 2.259ns 259.682ns 285.945ns 297.092ns 301.054ns 21.48% 1.690 1.742 5.43% 0.981ns 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.891ns; 256.736ns] or [-0.754%; +0.754%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 205.881µs 206.414µs ± 0.230µs 206.403µs ± 0.153µs 206.537µs 206.834µs 207.043µs 207.084µs 0.33% 0.555 0.027 0.11% 0.016µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4828969.011op/s 4844631.808op/s ± 5401.237op/s 4844886.380op/s ± 3583.221op/s 4848644.961op/s 4852306.861op/s 4853668.705op/s 4857165.211op/s 0.25% -0.549 0.018 0.11% 381.925op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.212µs 18.329µs ± 0.090µs 18.312µs ± 0.043µs 18.361µs 18.491µs 18.582µs 18.956µs 3.52% 2.405 11.524 0.49% 0.006µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52754891.465op/s 54559450.880op/s ± 264784.655op/s 54609651.251op/s ± 127957.419op/s 54730207.745op/s 54881288.209op/s 54899787.341op/s 54909915.439op/s 0.55% -2.295 10.565 0.48% 18723.103op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.690µs 10.837µs ± 0.064µs 10.826µs ± 0.039µs 10.877µs 10.945µs 10.981µs 11.073µs 2.28% 0.499 0.386 0.59% 0.005µs 1 200
normalization/normalize_name/normalize_name/good throughput 90313809.464op/s 92282201.844op/s ± 544575.383op/s 92368592.017op/s ± 335317.731op/s 92659854.195op/s 93072863.997op/s 93478559.937op/s 93546438.309op/s 1.28% -0.461 0.327 0.59% 38507.295op/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 [206.382µs; 206.446µs] or [-0.015%; +0.015%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4843883.248op/s; 4845380.367op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.317µs; 18.342µs] or [-0.068%; +0.068%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [54522754.274op/s; 54596147.487op/s] or [-0.067%; +0.067%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.828µs; 10.846µs] or [-0.082%; +0.082%] None None None
normalization/normalize_name/normalize_name/good throughput [92206728.934op/s; 92357674.755op/s] or [-0.082%; +0.082%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 71.867ms 72.354ms ± 0.614ms 72.317ms ± 0.062ms 72.385ms 72.521ms 72.695ms 80.808ms 11.74% 13.111 178.042 0.85% 0.043ms 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 [72.269ms; 72.439ms] or [-0.118%; +0.118%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.191µs 3.225µs ± 1.407µs 3.015µs ± 0.025µs 3.039µs 3.675µs 13.844µs 14.788µs 390.43% 7.305 54.729 43.51% 0.099µ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.030µs; 3.420µs] or [-6.045%; +6.045%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 8.247ms 8.267ms ± 0.012ms 8.265ms ± 0.006ms 8.271ms 8.284ms 8.297ms 8.343ms 0.95% 2.700 14.210 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 [8.265ms; 8.268ms] or [-0.020%; +0.020%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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.001µs 3.913µs 3.916µs 3.918µs 3.922µs 0.27% -1.231 12.711 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 254957766.949op/s 255634452.288op/s ± 172463.748op/s 255642838.262op/s ± 87414.627op/s 255729255.427op/s 255840069.880op/s 255907427.832op/s 256865140.276op/s 0.48% 1.258 12.888 0.07% 12195.029op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 79.653µs 81.097µs ± 0.507µs 81.035µs ± 0.324µs 81.372µs 82.040µs 82.391µs 82.777µs 2.15% 0.563 0.631 0.62% 0.036µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12080708.093op/s 12331336.138op/s ± 76870.872op/s 12340336.328op/s ± 49308.452op/s 12385626.480op/s 12431597.490op/s 12479340.781op/s 12554484.183op/s 1.74% -0.520 0.577 0.62% 5435.591op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 75.256µs 75.657µs ± 0.133µs 75.632µs ± 0.064µs 75.709µs 75.888µs 76.074µs 76.312µs 0.90% 0.960 3.815 0.18% 0.009µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13104163.518op/s 13217657.378op/s ± 23249.898op/s 13221997.487op/s ± 11243.060op/s 13230351.790op/s 13240873.545op/s 13279741.427op/s 13288018.194op/s 0.50% -0.934 3.748 0.18% 1644.016op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.891µs 3.912µs ± 0.003µs 3.911µs ± 0.001µs 3.913µs 3.917µs 3.918µs 3.919µs 0.19% -1.349 14.046 0.07% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255166879.838op/s 255643818.509op/s ± 180340.540op/s 255658570.529op/s ± 87655.601op/s 255746168.577op/s 255845298.383op/s 255911075.464op/s 256979578.415op/s 0.52% 1.379 14.280 0.07% 12752.002op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 72.404µs 72.863µs ± 0.147µs 72.856µs ± 0.079µs 72.935µs 73.106µs 73.261µs 73.604µs 1.03% 0.580 3.610 0.20% 0.010µs 1 200
credit_card/is_card_number/378282246310005 throughput 13586141.899op/s 13724357.273op/s ± 27606.438op/s 13725661.816op/s ± 14818.547op/s 13740411.272op/s 13772026.470op/s 13791159.366op/s 13811456.603op/s 0.63% -0.548 3.525 0.20% 1952.070op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.764µs 52.906µs ± 0.055µs 52.902µs ± 0.038µs 52.946µs 52.995µs 53.033µs 53.109µs 0.39% 0.273 0.485 0.10% 0.004µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 18829183.441op/s 18901334.831op/s ± 19639.817op/s 18902887.416op/s ± 13651.913op/s 18915089.513op/s 18930479.305op/s 18942871.494op/s 18952298.869op/s 0.26% -0.266 0.473 0.10% 1388.745op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.428µs 6.437µs ± 0.004µs 6.437µs ± 0.003µs 6.439µs 6.445µs 6.448µs 6.449µs 0.18% 0.329 0.041 0.06% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 155072827.349op/s 155347549.780op/s ± 99637.624op/s 155350210.259op/s ± 61212.172op/s 155415751.387op/s 155505228.840op/s 155550734.573op/s 155570287.236op/s 0.14% -0.325 0.037 0.06% 7045.444op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.892µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.931µs 0.47% -0.133 12.541 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254386779.130op/s 255577560.022op/s ± 207293.613op/s 255573861.528op/s ± 103332.066op/s 255686116.251op/s 255825648.786op/s 255896662.417op/s 256914073.144op/s 0.52% 0.168 12.605 0.08% 14657.872op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.955µs 65.093µs ± 0.087µs 65.074µs ± 0.049µs 65.135µs 65.256µs 65.329µs 65.591µs 0.79% 1.915 6.541 0.13% 0.006µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15246003.171op/s 15362663.003op/s ± 20406.431op/s 15367057.641op/s ± 11602.161op/s 15376664.374op/s 15384592.025op/s 15389286.384op/s 15395252.104op/s 0.18% -1.895 6.412 0.13% 1442.953op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.169µs 58.342µs ± 0.129µs 58.313µs ± 0.064µs 58.385µs 58.590µs 58.758µs 59.001µs 1.18% 1.704 3.866 0.22% 0.009µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16948983.854op/s 17140417.921op/s ± 37778.788op/s 17148970.669op/s ± 18939.412op/s 17166702.606op/s 17179637.834op/s 17189763.066op/s 17191326.976op/s 0.25% -1.685 3.757 0.22% 2671.364op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.912µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.916µs 3.919µs 3.923µs 0.29% -0.496 8.656 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254916212.751op/s 255645512.325op/s ± 180460.862op/s 255666703.444op/s ± 100745.704op/s 255756177.510op/s 255861262.496op/s 255920037.742op/s 256801445.563op/s 0.44% 0.518 8.764 0.07% 12760.510op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 55.101µs 55.345µs ± 0.157µs 55.312µs ± 0.082µs 55.402µs 55.649µs 55.866µs 55.998µs 1.24% 1.325 2.157 0.28% 0.011µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17857808.825op/s 18068571.753op/s ± 51161.399op/s 18079264.143op/s ± 26797.772op/s 18105506.337op/s 18127607.268op/s 18145219.178op/s 18148565.561op/s 0.38% -1.305 2.078 0.28% 3617.657op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.719µs 52.866µs ± 0.061µs 52.872µs ± 0.046µs 52.910µs 52.957µs 53.001µs 53.021µs 0.28% -0.092 -0.537 0.12% 0.004µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 18860277.407op/s 18915681.375op/s ± 21982.167op/s 18913711.864op/s ± 16311.412op/s 18932530.615op/s 18950994.532op/s 18961791.103op/s 18968521.738op/s 0.29% 0.097 -0.538 0.12% 1554.374op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.428µs 6.436µs ± 0.005µs 6.435µs ± 0.002µs 6.438µs 6.445µs 6.450µs 6.468µs 0.51% 2.116 9.147 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 154599591.535op/s 155372139.343op/s ± 117632.362op/s 155390637.716op/s ± 57939.964op/s 155448799.265op/s 155513567.671op/s 155552934.052op/s 155567873.292op/s 0.11% -2.101 9.025 0.08% 8317.864op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255610550.471op/s; 255658354.104op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [81.027µs; 81.168µs] or [-0.087%; +0.087%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12320682.575op/s; 12341989.702op/s] or [-0.086%; +0.086%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [75.638µs; 75.675µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13214435.165op/s; 13220879.590op/s] or [-0.024%; +0.024%] None None None
credit_card/is_card_number/37828224631 execution_time [3.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631 throughput [255618825.045op/s; 255668811.974op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/378282246310005 execution_time [72.843µs; 72.884µs] or [-0.028%; +0.028%] None None None
credit_card/is_card_number/378282246310005 throughput [13720531.286op/s; 13728183.260op/s] or [-0.028%; +0.028%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.899µs; 52.914µs] or [-0.014%; +0.014%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [18898612.941op/s; 18904056.721op/s] or [-0.014%; +0.014%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.437µs; 6.438µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 throughput [155333740.964op/s; 155361358.597op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ throughput [255548831.120op/s; 255606288.923op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.081µs; 65.105µs] or [-0.018%; +0.018%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15359834.868op/s; 15365491.139op/s] or [-0.018%; +0.018%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.324µs; 58.360µs] or [-0.031%; +0.031%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17135182.144op/s; 17145653.697op/s] or [-0.031%; +0.031%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255620502.186op/s; 255670522.465op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [55.323µs; 55.367µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18061481.275op/s; 18075662.231op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.858µs; 52.875µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [18912634.859op/s; 18918727.892op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.435µs; 6.437µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155355836.629op/s; 155388442.057op/s] or [-0.010%; +0.010%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 535.583µs 536.431µs ± 0.463µs 536.406µs ± 0.242µs 536.637µs 537.065µs 537.510µs 540.347µs 0.73% 3.164 24.287 0.09% 0.033µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1850663.839op/s 1864174.694op/s ± 1604.296op/s 1864260.148op/s ± 840.243op/s 1865136.019op/s 1866218.451op/s 1867002.078op/s 1867125.262op/s 0.15% -3.123 23.840 0.09% 113.441op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 382.613µs 383.330µs ± 0.325µs 383.323µs ± 0.228µs 383.555µs 383.865µs 384.008µs 384.217µs 0.23% 0.106 -0.398 0.08% 0.023µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2602694.025op/s 2608723.521op/s ± 2211.392op/s 2608763.810op/s ± 1551.538op/s 2610237.679op/s 2612199.520op/s 2613430.877op/s 2613610.066op/s 0.19% -0.102 -0.400 0.08% 156.369op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 194.738µs 195.524µs ± 0.404µs 195.597µs ± 0.294µs 195.801µs 196.146µs 196.430µs 196.581µs 0.50% -0.008 -0.750 0.21% 0.029µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5086963.652op/s 5114485.530op/s ± 10566.322op/s 5112553.539op/s ± 7678.213op/s 5124045.043op/s 5131064.676op/s 5134362.358op/s 5135115.011op/s 0.44% 0.016 -0.756 0.21% 747.152op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 38.031µs 38.148µs ± 0.046µs 38.145µs ± 0.030µs 38.178µs 38.220µs 38.299µs 38.331µs 0.49% 0.653 1.423 0.12% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26088564.776op/s 26213708.702op/s ± 31595.339op/s 26215949.988op/s ± 20912.497op/s 26233424.781op/s 26260733.667op/s 26274396.311op/s 26294252.405op/s 0.30% -0.642 1.394 0.12% 2234.128op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.889µs 46.551µs ± 0.560µs 46.116µs ± 0.148µs 47.136µs 47.300µs 47.348µs 47.374µs 2.73% 0.202 -1.857 1.20% 0.040µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21108679.443op/s 21484721.292op/s ± 257739.861op/s 21684330.385op/s ± 69610.083op/s 21723293.160op/s 21746156.441op/s 21762703.720op/s 21791925.849op/s 0.50% -0.198 -1.861 1.20% 18224.960op/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 [536.367µs; 536.495µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1863952.354op/s; 1864397.034op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [383.284µs; 383.375µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2608417.044op/s; 2609029.999op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [195.468µs; 195.580µs] or [-0.029%; +0.029%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5113021.139op/s; 5115949.920op/s] or [-0.029%; +0.029%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [38.142µs; 38.154µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26209329.892op/s; 26218087.512op/s] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [46.474µs; 46.629µs] or [-0.167%; +0.167%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21449001.026op/s; 21520441.557op/s] or [-0.166%; +0.166%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz dbc4779 1752609913 yiming.luo/send-data-get-mut-target
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 151.392µs 152.452µs ± 0.305µs 152.447µs ± 0.152µs 152.588µs 152.799µs 153.267µs 154.819µs 1.56% 2.462 19.019 0.20% 0.022µ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 [152.410µs; 152.495µs] or [-0.028%; +0.028%] None None None

Baseline

Omitted due to size.

@ekump
Copy link
Contributor

ekump commented Jul 14, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 70.23 MB 70.23 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 9.24 MB 9.24 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 22.10 MB 22.10 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.09 MB 9.09 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 82.45 MB 82.45 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 26.16 MB 26.16 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 18.37 MB 18.37 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 64.65 KB 64.65 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 124.80 MB 124.80 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 644.68 MB 644.69 MB +0% (+8.20 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 5.87 MB 5.87 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 64.65 KB 64.65 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 17.33 MB 17.33 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 32.14 MB 32.14 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 15.66 MB 15.66 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 65.65 KB 65.65 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 127.13 MB 127.14 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 634.31 MB 634.32 MB +0% (+7.77 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.47 MB 4.47 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 65.65 KB 65.65 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 18.47 MB 18.47 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 30.18 MB 30.18 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 62.96 MB 62.96 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.83 MB 9.83 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 20.95 MB 20.95 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 77.43 MB 77.43 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.74 MB 9.74 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 24.08 MB 24.08 MB 0% (0 B) 👌

@lym953 lym953 force-pushed the yiming.luo/send-data-get-mut-target branch 2 times, most recently from e5112d1 to 0b1b61e Compare July 15, 2025 13:55
@lym953 lym953 changed the title Add SendData.set_api_key() Add functions to SendDataBuilder Jul 15, 2025
@lym953 lym953 marked this pull request as ready for review July 15, 2025 14:10
@lym953 lym953 requested a review from ekump July 15, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants