Skip to content

[crashtracking] Little improvements to the FFI api #842

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

Merged
merged 7 commits into from
Feb 6, 2025

Conversation

gleocadie
Copy link
Contributor

@gleocadie gleocadie commented Jan 24, 2025

What does this PR do?

This PR tries to improve a bit the crashtracker ffi APIs.

Motivation

The goal is to simplify the crashtracker ffi API and adding code in the crashinfo.cpp example.

Implementation

  • When passing an address, instead of asking for a string, pass a usize (expecting it to be 64bit on x86_64, and 32bit on x86 architecture) and build a 0x-prefixed string from it.
  • Experimental :
    ddog_crasht_CrashInfoBuilder_with_stack adds the callstack of the crashing threads but only the callstack.
    If we want to add the crashing thread (ThreadData), we have to duplicate the callstack and make one calls to ddog_crasht_CrashInfoBuilder_with_stack and ddog_crasht_CrashInfoBuilder_with_thread.
    Instead, we check the crashed field, and call into with_stack to add a duplicate of the callstack thread (if it's true) and call into with_thread with the thread data
    Maybe we could remove the ddog_crasht_CrashInfoBuilder_with_stack ?
  • Add XXXNewResult types to have shorter symbols for the generated code.

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from 95c725e to a21b4c8 Compare January 24, 2025 09:46
@pr-commenter
Copy link

pr-commenter bot commented Jan 24, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-02-06 08:53:32

Comparing candidate commit 1987c10 in PR branch gleocadie/crashtracker-new-format-improvements with baseline commit f2fb806 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 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 700.718µs 702.120µs ± 0.752µs 702.056µs ± 0.353µs 702.405µs 703.092µs 703.619µs 709.306µs 1.03% 4.539 40.323 0.11% 0.053µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1409829.374op/s 1424259.386op/s ± 1517.394op/s 1424387.252op/s ± 715.600op/s 1425086.349op/s 1426049.069op/s 1426426.319op/s 1427107.467op/s 0.19% -4.470 39.459 0.11% 107.296op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 472.724µs 473.971µs ± 0.916µs 473.868µs ± 0.255µs 474.165µs 474.632µs 475.484µs 484.266µs 2.19% 7.957 82.351 0.19% 0.065µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2064980.816op/s 2109841.788op/s ± 4015.821op/s 2110292.669op/s ± 1135.743op/s 2111304.647op/s 2112873.706op/s 2114838.355op/s 2115397.376op/s 0.24% -7.836 80.473 0.19% 283.961op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 190.240µs 190.720µs ± 0.636µs 190.661µs ± 0.125µs 190.776µs 190.992µs 191.196µs 196.995µs 3.32% 8.731 80.924 0.33% 0.045µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5076262.382op/s 5243334.492op/s ± 16984.565op/s 5244922.411op/s ± 3432.785op/s 5248436.774op/s 5252630.342op/s 5254626.323op/s 5256528.710op/s 0.22% -8.664 80.066 0.32% 1200.990op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 46.281µs 46.469µs ± 0.190µs 46.447µs ± 0.042µs 46.496µs 46.569µs 46.649µs 48.263µs 3.91% 8.076 72.698 0.41% 0.013µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 20719960.253op/s 21520239.730op/s ± 85420.005op/s 21529832.578op/s ± 19649.732op/s 21547379.539op/s 21576467.260op/s 21600853.162op/s 21607359.284op/s 0.36% -7.958 71.278 0.40% 6040.106op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 49.044µs 49.241µs ± 0.085µs 49.238µs ± 0.056µs 49.291µs 49.378µs 49.484µs 49.522µs 0.58% 0.403 0.201 0.17% 0.006µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20192984.586op/s 20308233.326op/s ± 35153.161op/s 20309618.974op/s ± 23025.059op/s 20332981.826op/s 20356992.388op/s 20381024.956op/s 20389763.214op/s 0.39% -0.393 0.184 0.17% 2485.704op/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 [702.016µs; 702.224µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1424049.090op/s; 1424469.682op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [473.844µs; 474.098µs] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2109285.234op/s; 2110398.342op/s] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.632µs; 190.808µs] or [-0.046%; +0.046%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5240980.594op/s; 5245688.389op/s] or [-0.045%; +0.045%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [46.442µs; 46.495µs] or [-0.057%; +0.057%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [21508401.339op/s; 21532078.121op/s] or [-0.055%; +0.055%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [49.229µs; 49.253µs] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [20303361.436op/s; 20313105.216op/s] or [-0.024%; +0.024%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.374µs 5.449µs ± 0.047µs 5.442µs ± 0.033µs 5.477µs 5.545µs 5.547µs 5.551µs 1.99% 0.897 -0.428 0.87% 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.443µs; 5.456µs] or [-0.121%; +0.121%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 57.420ms 57.689ms ± 0.121ms 57.676ms ± 0.055ms 57.733ms 57.881ms 58.129ms 58.272ms 1.03% 1.341 4.383 0.21% 0.009ms 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 [57.672ms; 57.705ms] or [-0.029%; +0.029%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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.261µs 27.837µs ± 14.098µs 18.585µs ± 0.229µs 36.759µs 46.398µs 55.338µs 149.329µs 703.49% 3.805 27.351 50.52% 0.997µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [25.883µs; 29.791µs] or [-7.019%; +7.019%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 69.218µs 69.407µs ± 0.204µs 69.384µs ± 0.049µs 69.433µs 69.529µs 69.851µs 71.977µs 3.74% 10.264 125.704 0.29% 0.014µ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 [69.379µs; 69.435µs] or [-0.041%; +0.041%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 38.921µs 39.469µs ± 0.891µs 39.051µs ± 0.049µs 39.157µs 41.342µs 41.442µs 42.518µs 8.88% 1.676 0.998 2.25% 0.063µ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 [39.345µs; 39.592µs] or [-0.313%; +0.313%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 260.304ns 273.750ns ± 14.647ns 265.590ns ± 3.268ns 278.813ns 305.545ns 312.223ns 315.075ns 18.63% 1.280 0.353 5.34% 1.036ns 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 [271.720ns; 275.780ns] or [-0.742%; +0.742%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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.427µs 3.313µs ± 1.473µs 3.117µs ± 0.028µs 3.145µs 3.760µs 14.424µs 15.413µs 394.51% 7.472 56.428 44.35% 0.104µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.109µs; 3.517µs] or [-6.162%; +6.162%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 181.043µs 184.671µs ± 1.682µs 184.332µs ± 0.965µs 185.542µs 187.251µs 190.982µs 192.170µs 4.25% 1.219 3.223 0.91% 0.119µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5203733.991op/s 5415476.994op/s ± 48792.955op/s 5424981.157op/s ± 28551.681op/s 5446801.836op/s 5482548.907op/s 5497837.129op/s 5523562.621op/s 1.82% -1.121 2.811 0.90% 3450.183op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 21.035µs 21.482µs ± 0.228µs 21.548µs ± 0.074µs 21.602µs 21.830µs 21.988µs 22.035µs 2.26% -0.376 -0.454 1.06% 0.016µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 45381316.512op/s 46554920.534op/s ± 496179.479op/s 46408945.190op/s ± 159025.976op/s 46840203.152op/s 47399202.660op/s 47459823.219op/s 47539081.086op/s 2.44% 0.419 -0.482 1.06% 35085.187op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 14.206µs 14.297µs ± 0.038µs 14.297µs ± 0.024µs 14.319µs 14.363µs 14.397µs 14.423µs 0.88% 0.463 0.603 0.26% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 69332061.682op/s 69945841.017op/s ± 185372.449op/s 69943411.231op/s ± 118861.727op/s 70064430.796op/s 70235453.798op/s 70310588.967op/s 70392751.492op/s 0.64% -0.444 0.571 0.26% 13107.812op/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 [184.438µs; 184.904µs] or [-0.126%; +0.126%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5408714.760op/s; 5422239.229op/s] or [-0.125%; +0.125%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [21.451µs; 21.514µs] or [-0.147%; +0.147%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [46486154.830op/s; 46623686.238op/s] or [-0.148%; +0.148%] None None None
normalization/normalize_name/normalize_name/good execution_time [14.292µs; 14.302µs] or [-0.037%; +0.037%] None None None
normalization/normalize_name/normalize_name/good throughput [69920150.179op/s; 69971531.856op/s] or [-0.037%; +0.037%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 6.233ms 6.246ms ± 0.013ms 6.245ms ± 0.003ms 6.248ms 6.254ms 6.281ms 6.391ms 2.34% 8.437 86.215 0.20% 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 [6.245ms; 6.248ms] or [-0.028%; +0.028%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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.762µs 2.801µs ± 0.028µs 2.795µs ± 0.008µs 2.804µs 2.857µs 2.954µs 2.956µs 5.76% 3.172 13.341 0.98% 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.797µs; 2.805µs] or [-0.136%; +0.136%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 138.883µs 139.717µs ± 0.385µs 139.664µs ± 0.135µs 139.837µs 140.216µs 140.895µs 142.951µs 2.35% 3.667 25.945 0.27% 0.027µ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 [139.663µs; 139.770µs] or [-0.038%; +0.038%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1987c10 1738831355 gleocadie/crashtracker-new-format-improvements
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 4.274µs 4.288µs ± 0.005µs 4.288µs ± 0.001µs 4.289µs 4.293µs 4.295µs 4.351µs 1.48% 8.640 102.784 0.12% 0.000µs 1 200
credit_card/is_card_number/ throughput 229814351.985op/s 233188135.602op/s ± 281904.133op/s 233216476.747op/s ± 64331.731op/s 233272985.285op/s 233444894.202op/s 233573421.076op/s 233945654.986op/s 0.31% -8.530 101.108 0.12% 19933.632op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 89.524µs 90.821µs ± 0.579µs 90.791µs ± 0.306µs 91.099µs 91.744µs 92.016µs 95.076µs 4.72% 1.950 13.290 0.64% 0.041µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 10517939.685op/s 11011097.696op/s ± 69441.227op/s 11014322.480op/s ± 37041.061op/s 11048768.211op/s 11109105.362op/s 11152815.196op/s 11170201.477op/s 1.42% -1.741 11.544 0.63% 4910.236op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 82.965µs 83.611µs ± 0.356µs 83.590µs ± 0.130µs 83.720µs 83.938µs 84.244µs 87.666µs 4.88% 7.402 82.114 0.43% 0.025µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 11406987.236op/s 11960416.498op/s ± 49464.460op/s 11963174.961op/s ± 18600.040op/s 11981709.322op/s 12011084.350op/s 12034458.604op/s 12053299.691op/s 0.75% -7.034 76.682 0.41% 3497.665op/s 1 200
credit_card/is_card_number/37828224631 execution_time 4.274µs 4.289µs ± 0.004µs 4.289µs ± 0.001µs 4.290µs 4.292µs 4.293µs 4.337µs 1.13% 8.000 97.066 0.10% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 230553963.957op/s 233152839.420op/s ± 220480.679op/s 233152682.491op/s ± 56832.218op/s 233215803.269op/s 233363619.598op/s 233482352.290op/s 233977857.250op/s 0.35% -7.900 95.700 0.09% 15590.338op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 80.766µs 81.265µs ± 0.183µs 81.247µs ± 0.086µs 81.314µs 81.667µs 81.883µs 82.103µs 1.05% 1.323 3.134 0.22% 0.013µs 1 200
credit_card/is_card_number/378282246310005 throughput 12179795.389op/s 12305532.228op/s ± 27669.404op/s 12308181.641op/s ± 12988.743op/s 12322852.780op/s 12340513.186op/s 12353567.496op/s 12381445.166op/s 0.60% -1.301 3.059 0.22% 1956.522op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 58.555µs 58.678µs ± 0.044µs 58.673µs ± 0.023µs 58.701µs 58.745µs 58.790µs 58.915µs 0.41% 0.746 3.980 0.07% 0.003µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 16973486.422op/s 17042253.132op/s ± 12792.184op/s 17043492.303op/s ± 6732.124op/s 17049359.566op/s 17060909.278op/s 17074246.949op/s 17077921.663op/s 0.20% -0.734 3.931 0.07% 904.544op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.416µs 6.442µs ± 0.005µs 6.442µs ± 0.003µs 6.444µs 6.448µs 6.453µs 6.464µs 0.35% -1.176 6.893 0.08% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 154691336.000op/s 155242318.949op/s ± 131875.739op/s 155232613.523op/s ± 67668.663op/s 155309807.817op/s 155398797.133op/s 155812593.214op/s 155850307.436op/s 0.40% 1.195 6.938 0.08% 9325.023op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 4.273µs 4.288µs ± 0.003µs 4.288µs ± 0.001µs 4.290µs 4.293µs 4.296µs 4.296µs 0.19% -0.502 5.961 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 232749222.240op/s 233187489.980op/s ± 140955.748op/s 233199630.880op/s ± 68103.378op/s 233257727.870op/s 233402179.986op/s 233532605.481op/s 234009751.577op/s 0.35% 0.516 6.021 0.06% 9967.077op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 69.102µs 69.874µs ± 0.345µs 69.855µs ± 0.235µs 70.094µs 70.453µs 70.633µs 71.239µs 1.98% 0.412 0.431 0.49% 0.024µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 14037278.299op/s 14311845.233op/s ± 70511.524op/s 14315348.238op/s ± 48261.727op/s 14363015.938op/s 14414033.683op/s 14456782.571op/s 14471421.220op/s 1.09% -0.379 0.360 0.49% 4985.918op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 63.904µs 65.078µs ± 0.485µs 65.100µs ± 0.319µs 65.382µs 65.856µs 66.182µs 66.309µs 1.86% 0.045 -0.229 0.74% 0.034µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 15080841.143op/s 15367031.203op/s ± 114505.020op/s 15361028.471op/s ± 75343.133op/s 15451470.424op/s 15559174.636op/s 15624664.548op/s 15648490.200op/s 1.87% -0.005 -0.236 0.74% 8096.728op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 4.272µs 4.289µs ± 0.002µs 4.289µs ± 0.001µs 4.290µs 4.294µs 4.295µs 4.295µs 0.16% -1.220 11.528 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 232818131.700op/s 233168112.343op/s ± 132943.480op/s 233179713.365op/s ± 60940.481op/s 233237008.882op/s 233301788.427op/s 233503737.474op/s 234096166.946op/s 0.39% 1.241 11.670 0.06% 9400.524op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 61.735µs 61.990µs ± 0.099µs 61.970µs ± 0.055µs 62.036µs 62.172µs 62.266µs 62.297µs 0.53% 0.725 0.540 0.16% 0.007µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 16052248.682op/s 16131749.097op/s ± 25620.027op/s 16136819.511op/s ± 14212.176op/s 16148394.173op/s 16164316.306op/s 16183853.031op/s 16198376.923op/s 0.38% -0.715 0.529 0.16% 1811.609op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 58.561µs 58.685µs ± 0.034µs 58.684µs ± 0.019µs 58.702µs 58.745µs 58.771µs 58.792µs 0.18% 0.098 0.791 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 17009257.313op/s 17040247.756op/s ± 9787.179op/s 17040336.670op/s ± 5463.651op/s 17045819.862op/s 17056129.163op/s 17060049.408op/s 17076144.626op/s 0.21% -0.093 0.793 0.06% 692.058op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.412µs 6.443µs ± 0.004µs 6.443µs ± 0.002µs 6.445µs 6.449µs 6.451µs 6.454µs 0.19% -1.572 12.000 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 154931902.786op/s 155212598.741op/s ± 103081.897op/s 155219178.790op/s ± 57702.927op/s 155266862.594op/s 155370783.480op/s 155406997.471op/s 155952162.732op/s 0.47% 1.595 12.181 0.07% 7288.991op/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 [4.288µs; 4.289µs] or [-0.017%; +0.017%] None None None
credit_card/is_card_number/ throughput [233149066.400op/s; 233227204.803op/s] or [-0.017%; +0.017%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [90.741µs; 90.901µs] or [-0.088%; +0.088%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [11001473.810op/s; 11020721.582op/s] or [-0.087%; +0.087%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [83.561µs; 83.660µs] or [-0.059%; +0.059%] None None None
credit_card/is_card_number/ 378282246310005 throughput [11953561.200op/s; 11967271.797op/s] or [-0.057%; +0.057%] None None None
credit_card/is_card_number/37828224631 execution_time [4.288µs; 4.290µs] or [-0.013%; +0.013%] None None None
credit_card/is_card_number/37828224631 throughput [233122282.918op/s; 233183395.921op/s] or [-0.013%; +0.013%] None None None
credit_card/is_card_number/378282246310005 execution_time [81.239µs; 81.290µs] or [-0.031%; +0.031%] None None None
credit_card/is_card_number/378282246310005 throughput [12301697.515op/s; 12309366.941op/s] or [-0.031%; +0.031%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [58.672µs; 58.684µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [17040480.258op/s; 17044026.005op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.441µs; 6.442µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/x371413321323331 throughput [155224042.240op/s; 155260595.658op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ execution_time [4.288µs; 4.289µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ throughput [233167954.869op/s; 233207025.091op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [69.826µs; 69.922µs] or [-0.068%; +0.068%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [14302073.014op/s; 14321617.452op/s] or [-0.068%; +0.068%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [65.011µs; 65.145µs] or [-0.103%; +0.103%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [15351161.908op/s; 15382900.497op/s] or [-0.103%; +0.103%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [4.288µs; 4.289µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [233149687.655op/s; 233186537.031op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [61.976µs; 62.003µs] or [-0.022%; +0.022%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [16128198.408op/s; 16135299.786op/s] or [-0.022%; +0.022%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [58.680µs; 58.689µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [17038891.347op/s; 17041604.165op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.442µs; 6.443µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155198312.581op/s; 155226884.900op/s] or [-0.009%; +0.009%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 21.27660% with 37 lines in your changes missing coverage. Please review.

Project coverage is 71.45%. Comparing base (55cdf99) to head (6678fa3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #842      +/-   ##
==========================================
- Coverage   71.48%   71.45%   -0.03%     
==========================================
  Files         320      319       -1     
  Lines       47115    47124       +9     
==========================================
- Hits        33680    33674       -6     
- Misses      13435    13450      +15     
Components Coverage Δ
crashtracker 43.31% <6.45%> (+0.05%) ⬆️
crashtracker-ffi 6.30% <6.45%> (+0.01%) ⬆️
datadog-alloc 98.73% <ø> (ø)
data-pipeline 91.48% <ø> (ø)
data-pipeline-ffi 90.08% <ø> (ø)
ddcommon 80.08% <50.00%> (-0.54%) ⬇️
ddcommon-ffi 61.05% <50.00%> (-1.07%) ⬇️
ddtelemetry 59.51% <ø> (ø)
ddtelemetry-ffi 22.46% <ø> (ø)
dogstatsd 90.01% <ø> (ø)
dogstatsd-client 79.77% <ø> (ø)
ipc 82.68% <ø> (ø)
profiling 80.04% <ø> (+0.06%) ⬆️
profiling-ffi 70.68% <ø> (+0.24%) ⬆️
serverless 0.00% <ø> (ø)
sidecar 41.79% <ø> (ø)
sidecar-ffi 10.78% <ø> (ø)
spawn-worker 54.37% <ø> (ø)
tinybytes 93.60% <ø> (ø)
trace-mini-agent 72.48% <ø> (ø)
trace-normalization 98.23% <ø> (ø)
trace-obfuscation 95.96% <ø> (ø)
trace-protobuf 77.67% <ø> (ø)
trace-utils 94.21% <ø> (ø)

@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from a21b4c8 to 6d17ec9 Compare January 30, 2025 10:19
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch 11 times, most recently from 8e1814b to 202ffdc Compare January 31, 2025 13:01
@gleocadie gleocadie changed the title [crashtracking] Improvements [crashtracking] Little improvements to the FFI api Jan 31, 2025
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from 06e271c to 92216f0 Compare January 31, 2025 13:39
) -> VoidResult {
wrap_with_void_ffi_result!({
if thread.crashed {
let stack = (thread.stack.to_inner_mut())?.clone();
builder.to_inner_mut()?.with_stack(stack)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if ddog_crasht_CrashInfoBuilder_with_stack shouldn't be removed ? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is only one executing thread, does it make sense to have it twice?

Copy link
Contributor

Choose a reason for hiding this comment

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

But you're the main user of this API, so do what makes sense to you!

) -> VoidResult {
wrap_with_void_ffi_result!({
if thread.crashed {
let stack = (thread.stack.to_inner_mut())?.clone();
builder.to_inner_mut()?.with_stack(stack)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is only one executing thread, does it make sense to have it twice?

) -> VoidResult {
wrap_with_void_ffi_result!({
if thread.crashed {
let stack = (thread.stack.to_inner_mut())?.clone();
builder.to_inner_mut()?.with_stack(stack)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

But you're the main user of this API, so do what makes sense to you!

@github-actions github-actions bot added the profiling Relates to the profiling* modules. label Jan 31, 2025
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch 6 times, most recently from e604600 to 82cd9e1 Compare January 31, 2025 23:16

////////////////////////////////////////////////////////////////////////////////////////////////////
// FFI API //
////////////////////////////////////////////////////////////////////////////////////////////////////

#[allow(dead_code)]
#[repr(C)]
pub enum StackTraceNewResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use ddcommon_ffi::Result e.g. ddcommon_ffi::Result<Handle<StackTrace>>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I use ddcommon_ffi::Result<Handle<StackFrame>> instead of StackFrameNewResult
The enum item name is
DDOG_CRASHT_STACK_FRAME_NEW_RESULT_OK_HANDLE_STACK_FRAME (with renaming)
or
DDOG_CRASHT_RESULT_HANDLE_FRAME_OK_HANDLE_STACK_FRAME

If I use the new enum StackFrameNewResult, I got this
DDOG_CRASHT_STACK_FRAME_NEW_RESULT_OK which is shorter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you know a way to prevent a new enum to have shorter name, I'll be happy :)

@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from 82cd9e1 to 5d0dbee Compare February 4, 2025 10:24
@gleocadie gleocadie marked this pull request as ready for review February 4, 2025 10:25
@gleocadie gleocadie requested review from a team as code owners February 4, 2025 10:25
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch 3 times, most recently from a2a6b6f to e14a873 Compare February 5, 2025 09:02
Copy link
Contributor

@danielsn danielsn left a comment

Choose a reason for hiding this comment

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

Looks good, just a few more minor comments


impl ToHexStr for usize {
fn to_hex_str(&self) -> String {
format!("0x{:X}", self)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this to be fixed length? i.e. should 2 be 0x2 or 0x0000000000000002?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷
the specification says that it's a hexadecimal string prefixed with 0x but nothing about the length.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed that either is standards compliant. Its just aesthetically, which do we prefer?

@gleocadie gleocadie enabled auto-merge (squash) February 5, 2025 17:38
@gleocadie gleocadie disabled auto-merge February 5, 2025 17:39
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from 6678fa3 to cbbb00a Compare February 6, 2025 08:40
@gleocadie gleocadie force-pushed the gleocadie/crashtracker-new-format-improvements branch from cbbb00a to 1987c10 Compare February 6, 2025 08:42
@gleocadie gleocadie merged commit 6f5396a into main Feb 6, 2025
31 checks passed
@gleocadie gleocadie deleted the gleocadie/crashtracker-new-format-improvements branch February 6, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common crashtracker profiling Relates to the profiling* modules.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants