Skip to content

Wrap ffi calls with catch_unwind. #1083

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 1 commit into
base: main
Choose a base branch
from

Conversation

hoolioh
Copy link
Contributor

@hoolioh hoolioh commented May 30, 2025

What does this PR do?

Prevent panics from unwindind in the host language so we can avoid UB.

Motivation

Currently there is no guarantee that the trace exporter methods are panic free so there is the possibility that unwinding in the host language can cause UB.

Additional Notes

The wrapper is feature gated by "catch_unwind" feature and it's enabled by default. The aim of the feature is having a mechanism to disable the feature if the performance penalty is higher than expected.

@hoolioh hoolioh force-pushed the julio/catch-panics-trace-exporter branch from 9b2b792 to 762337a Compare May 30, 2025 12:46
@pr-commenter
Copy link

pr-commenter bot commented May 30, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-06-03 07:28:07

Comparing candidate commit 67006bc in PR branch julio/catch-panics-trace-exporter with baseline commit 2a12816 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 67006bc 1748934991 julio/catch-panics-trace-exporter
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 32.531µs 33.479µs ± 1.210µs 32.741µs ± 0.106µs 34.986µs 35.809µs 36.027µs 36.394µs 11.16% 0.997 -0.797 3.61% 0.086µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [33.311µs; 33.647µs] or [-0.501%; +0.501%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.892µs 3.911µs ± 0.003µs 3.910µs ± 0.001µs 3.912µs 3.915µs 3.916µs 3.918µs 0.19% -1.192 10.500 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255255590.876op/s 255716202.581op/s ± 171543.109op/s 255737139.812op/s ± 93896.970op/s 255820459.245op/s 255910852.927op/s 256021614.060op/s 256907708.969op/s 0.46% 1.214 10.664 0.07% 12129.930op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 81.814µs 83.149µs ± 0.652µs 83.217µs ± 0.449µs 83.569µs 84.126µs 84.295µs 86.954µs 4.49% 0.893 4.382 0.78% 0.046µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11500363.022op/s 12027272.807op/s ± 93643.719op/s 12016737.832op/s ± 65221.990op/s 12098925.918op/s 12174134.576op/s 12200447.826op/s 12222864.231op/s 1.72% -0.769 3.623 0.78% 6621.611op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 79.123µs 80.370µs ± 0.391µs 80.376µs ± 0.122µs 80.505µs 80.658µs 80.766µs 84.787µs 5.49% 6.946 80.397 0.48% 0.028µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 11794268.703op/s 12442812.855op/s ± 58592.960op/s 12441468.491op/s ± 18910.716op/s 12459145.217op/s 12509630.165op/s 12547451.384op/s 12638562.884op/s 1.58% -6.457 73.882 0.47% 4143.148op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.892µs 3.911µs ± 0.003µs 3.910µs ± 0.001µs 3.912µs 3.915µs 3.916µs 3.918µs 0.20% -1.254 11.931 0.06% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 255238246.144op/s 255719440.690op/s ± 165874.419op/s 255743544.613op/s ± 77458.292op/s 255813769.176op/s 255918144.622op/s 255976248.095op/s 256905154.594op/s 0.45% 1.278 12.112 0.06% 11729.093op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 76.280µs 77.095µs ± 0.224µs 77.121µs ± 0.154µs 77.271µs 77.399µs 77.478µs 77.529µs 0.53% -0.595 0.173 0.29% 0.016µs 1 200
credit_card/is_card_number/378282246310005 throughput 12898476.095op/s 12971070.829op/s ± 37807.857op/s 12966719.629op/s ± 25829.087op/s 12993482.476op/s 13038980.754op/s 13066401.186op/s 13109659.681op/s 1.10% 0.611 0.212 0.29% 2673.419op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.349µs 51.404µs ± 0.036µs 51.397µs ± 0.022µs 51.423µs 51.471µs 51.504µs 51.518µs 0.23% 0.877 0.306 0.07% 0.003µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19410830.527op/s 19453736.453op/s ± 13460.632op/s 19456290.472op/s ± 8363.663op/s 19463967.817op/s 19471036.347op/s 19474597.763op/s 19474747.095op/s 0.09% -0.874 0.299 0.07% 951.810op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.034µs ± 0.005µs 6.034µs ± 0.003µs 6.037µs 6.044µs 6.046µs 6.053µs 0.32% 1.114 1.287 0.07% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 165216839.873op/s 165717411.334op/s ± 123488.942op/s 165738633.678op/s ± 73680.204op/s 165804983.571op/s 165865211.703op/s 165900954.509op/s 165928948.764op/s 0.11% -1.109 1.272 0.07% 8731.987op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.893µs 3.911µs ± 0.003µs 3.910µs ± 0.002µs 3.912µs 3.918µs 3.920µs 3.924µs 0.36% 0.352 5.531 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254819014.222op/s 255682719.594op/s ± 212827.943op/s 255723641.654op/s ± 109993.047op/s 255814764.913op/s 255890746.080op/s 255936898.623op/s 256855567.513op/s 0.44% -0.334 5.589 0.08% 15049.208op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.845µs 66.164µs ± 0.115µs 66.154µs ± 0.068µs 66.223µs 66.381µs 66.455µs 66.562µs 0.62% 0.547 0.707 0.17% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15023636.034op/s 15114113.056op/s ± 26275.291op/s 15116130.418op/s ± 15455.763op/s 15130955.942op/s 15154684.768op/s 15161243.423op/s 15187238.164op/s 0.47% -0.535 0.690 0.17% 1857.944op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 59.386µs 59.649µs ± 0.095µs 59.658µs ± 0.065µs 59.719µs 59.786µs 59.828µs 59.877µs 0.37% -0.370 -0.163 0.16% 0.007µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16700865.333op/s 16764811.253op/s ± 26614.007op/s 16762314.129op/s ± 18351.150op/s 16781710.458op/s 16813724.458op/s 16831032.347op/s 16839017.688op/s 0.46% 0.378 -0.155 0.16% 1881.894op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.912µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.916µs 3.918µs 3.919µs 0.19% -0.527 4.419 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255192294.929op/s 255654610.175op/s ± 187214.415op/s 255667389.629op/s ± 121936.807op/s 255781216.931op/s 255902518.694op/s 255955086.242op/s 256734434.383op/s 0.42% 0.540 4.492 0.07% 13238.058op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 56.469µs 56.942µs ± 0.146µs 56.961µs ± 0.084µs 57.038µs 57.153µs 57.222µs 57.277µs 0.56% -0.576 0.293 0.25% 0.010µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17459013.230op/s 17561867.765op/s ± 44948.288op/s 17555943.361op/s ± 25892.505op/s 17584795.746op/s 17642503.713op/s 17680989.660op/s 17708850.994op/s 0.87% 0.591 0.314 0.26% 3178.324op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.349µs 51.403µs ± 0.036µs 51.396µs ± 0.023µs 51.422µs 51.475µs 51.500µs 51.510µs 0.22% 0.865 0.140 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19413864.566op/s 19454006.313op/s ± 13687.217op/s 19456945.671op/s ± 8731.475op/s 19464597.790op/s 19470613.684op/s 19472929.804op/s 19474416.459op/s 0.09% -0.862 0.133 0.07% 967.832op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.028µs 6.034µs ± 0.003µs 6.033µs ± 0.002µs 6.036µs 6.039µs 6.046µs 6.048µs 0.24% 1.185 2.803 0.05% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 165352011.794op/s 165732274.181op/s ± 87411.515op/s 165743547.749op/s ± 51694.116op/s 165790094.050op/s 165850911.255op/s 165876059.820op/s 165898610.134op/s 0.09% -1.180 2.783 0.05% 6180.928op/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.910µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255692428.356op/s; 255739976.806op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [83.059µs; 83.240µs] or [-0.109%; +0.109%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12014294.689op/s; 12040250.926op/s] or [-0.108%; +0.108%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [80.315µs; 80.424µs] or [-0.067%; +0.067%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12434692.435op/s; 12450933.276op/s] or [-0.065%; +0.065%] None None None
credit_card/is_card_number/37828224631 execution_time [3.910µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631 throughput [255696452.090op/s; 255742429.289op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/378282246310005 execution_time [77.064µs; 77.126µs] or [-0.040%; +0.040%] None None None
credit_card/is_card_number/378282246310005 throughput [12965831.023op/s; 12976310.634op/s] or [-0.040%; +0.040%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [51.399µs; 51.409µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19451870.938op/s; 19455601.967op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.034µs; 6.035µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/x371413321323331 throughput [165700296.954op/s; 165734525.714op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.912µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ throughput [255653223.688op/s; 255712215.500op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [66.148µs; 66.179µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15110471.553op/s; 15117754.559op/s] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [59.636µs; 59.662µs] or [-0.022%; +0.022%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [16761122.808op/s; 16768499.698op/s] or [-0.022%; +0.022%] 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 [255628664.058op/s; 255680556.293op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [56.922µs; 56.962µs] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [17555638.364op/s; 17568097.165op/s] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [51.398µs; 51.408µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19452109.396op/s; 19455903.230op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.033µs; 6.034µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165720159.786op/s; 165744388.577op/s] or [-0.007%; +0.007%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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 146.433µs 147.484µs ± 0.522µs 147.426µs ± 0.174µs 147.625µs 147.991µs 149.013µs 152.812µs 3.65% 5.634 53.614 0.35% 0.037µ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 [147.412µs; 147.556µs] or [-0.049%; +0.049%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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 214.908µs 215.641µs ± 0.666µs 215.484µs ± 0.243µs 215.886µs 216.196µs 216.705µs 221.522µs 2.80% 6.201 50.085 0.31% 0.047µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4514228.396op/s 4637385.324op/s ± 14046.649op/s 4640724.706op/s ± 5238.002op/s 4644318.824op/s 4648103.659op/s 4650046.746op/s 4653147.103op/s 0.27% -6.076 48.646 0.30% 993.248op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 19.663µs 19.794µs ± 0.050µs 19.800µs ± 0.038µs 19.831µs 19.863µs 19.896µs 19.929µs 0.65% -0.312 -0.376 0.25% 0.004µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 50178196.930op/s 50521651.891op/s ± 128472.859op/s 50505530.198op/s ± 97212.030op/s 50615092.348op/s 50727286.233op/s 50831323.738op/s 50857668.945op/s 0.70% 0.324 -0.370 0.25% 9084.403op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 11.997µs 12.141µs ± 0.033µs 12.143µs ± 0.016µs 12.159µs 12.185µs 12.215µs 12.252µs 0.90% -0.823 3.445 0.27% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 81617089.598op/s 82362844.569op/s ± 223046.942op/s 82355151.472op/s ± 109074.984op/s 82455525.552op/s 82706832.248op/s 83083550.879op/s 83353954.754op/s 1.21% 0.862 3.536 0.27% 15771.801op/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 [215.549µs; 215.733µs] or [-0.043%; +0.043%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4635438.593op/s; 4639332.054op/s] or [-0.042%; +0.042%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [19.787µs; 19.801µs] or [-0.035%; +0.035%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [50503846.789op/s; 50539456.994op/s] or [-0.035%; +0.035%] None None None
normalization/normalize_name/normalize_name/good execution_time [12.137µs; 12.146µs] or [-0.037%; +0.037%] None None None
normalization/normalize_name/normalize_name/good throughput [82331932.408op/s; 82393756.731op/s] or [-0.038%; +0.038%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.310ms 73.651ms ± 0.131ms 73.639ms ± 0.085ms 73.725ms 73.866ms 73.973ms 74.037ms 0.54% 0.305 -0.165 0.18% 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 [73.633ms; 73.669ms] or [-0.025%; +0.025%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.964ms 5.977ms ± 0.007ms 5.976ms ± 0.003ms 5.979ms 5.986ms 6.003ms 6.028ms 0.88% 3.040 16.754 0.12% 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 [5.976ms; 5.978ms] or [-0.016%; +0.016%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.748µs 65.938µs ± 0.211µs 65.912µs ± 0.045µs 65.959µs 66.065µs 66.360µs 68.477µs 3.89% 9.347 105.247 0.32% 0.015µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [65.909µs; 65.967µs] or [-0.044%; +0.044%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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 247.856ns 259.451ns ± 14.489ns 252.436ns ± 2.816ns 265.858ns 289.379ns 306.460ns 312.626ns 23.84% 1.776 2.531 5.57% 1.025ns 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 [257.443ns; 261.459ns] or [-0.774%; +0.774%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.389µs 2.454µs ± 0.050µs 2.439µs ± 0.014µs 2.466µs 2.567µs 2.610µs 2.616µs 7.27% 1.531 2.113 2.02% 0.004µ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.447µs; 2.461µs] or [-0.280%; +0.280%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.919µs 5.001µs ± 0.047µs 5.006µs ± 0.048µs 5.031µs 5.075µs 5.077µs 5.079µs 1.47% 0.043 -1.247 0.93% 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 [4.995µs; 5.008µs] or [-0.129%; +0.129%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.390µs 24.390µs ± 10.291µs 17.561µs ± 0.088µs 34.123µs 44.854µs 51.848µs 86.689µs 393.65% 1.811 5.590 42.09% 0.728µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [22.964µs; 25.816µs] or [-5.847%; +5.847%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
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.232µs 3.126µs ± 1.464µs 2.949µs ± 0.024µs 2.970µs 3.230µs 13.903µs 15.509µs 425.88% 7.560 57.557 46.73% 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 [2.923µs; 3.329µs] or [-6.493%; +6.493%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 67006bc 1748934991 julio/catch-panics-trace-exporter
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 533.254µs 534.042µs ± 1.154µs 533.759µs ± 0.236µs 534.046µs 535.631µs 538.773µs 542.964µs 1.72% 4.338 22.828 0.22% 0.082µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1841741.933op/s 1872521.196op/s ± 4009.161op/s 1873503.367op/s ± 829.040op/s 1874294.642op/s 1875074.724op/s 1875175.816op/s 1875280.396op/s 0.09% -4.299 22.378 0.21% 283.490op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 449.454µs 450.136µs ± 0.674µs 450.040µs ± 0.214µs 450.327µs 450.624µs 450.754µs 458.648µs 1.91% 10.126 125.323 0.15% 0.048µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2180322.005op/s 2221553.696op/s ± 3278.410op/s 2222023.598op/s ± 1054.003op/s 2222828.931op/s 2223964.365op/s 2224446.008op/s 2224921.546op/s 0.13% -10.015 123.455 0.15% 231.819op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 184.102µs 185.059µs ± 0.343µs 185.119µs ± 0.234µs 185.316µs 185.537µs 185.725µs 185.804µs 0.37% -0.381 -0.432 0.18% 0.024µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5382000.974op/s 5403701.457op/s ± 10011.444op/s 5401925.184op/s ± 6831.552op/s 5410903.689op/s 5421494.976op/s 5425528.193op/s 5431759.716op/s 0.55% 0.389 -0.427 0.18% 707.916op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 39.668µs 39.792µs ± 0.054µs 39.792µs ± 0.041µs 39.828µs 39.881µs 39.934µs 39.966µs 0.44% 0.476 0.209 0.13% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 25021072.661op/s 25130985.670op/s ± 33800.705op/s 25130931.428op/s ± 25778.150op/s 25157374.467op/s 25178895.328op/s 25191975.205op/s 25209075.034op/s 0.31% -0.468 0.194 0.13% 2390.071op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.289µs 45.489µs ± 0.094µs 45.512µs ± 0.071µs 45.567µs 45.619µs 45.648µs 45.668µs 0.34% -0.294 -1.098 0.21% 0.007µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21897128.265op/s 21983306.795op/s ± 45654.586op/s 21972101.057op/s ± 34298.160op/s 22025004.636op/s 22056535.975op/s 22078960.082op/s 22080205.611op/s 0.49% 0.299 -1.095 0.21% 3228.267op/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 [533.882µs; 534.202µs] or [-0.030%; +0.030%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1871965.564op/s; 1873076.827op/s] or [-0.030%; +0.030%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [450.043µs; 450.230µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2221099.340op/s; 2222008.052op/s] or [-0.020%; +0.020%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [185.011µs; 185.106µs] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5402313.967op/s; 5405088.947op/s] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [39.784µs; 39.799µs] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [25126301.217op/s; 25135670.122op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.476µs; 45.502µs] or [-0.029%; +0.029%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21976979.508op/s; 21989634.081op/s] or [-0.029%; +0.029%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 42 lines in your changes missing coverage. Please review.

Project coverage is 70.92%. Comparing base (2a12816) to head (67006bc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1083      +/-   ##
==========================================
- Coverage   70.96%   70.92%   -0.04%     
==========================================
  Files         330      330              
  Lines       49898    49936      +38     
==========================================
+ Hits        35409    35419      +10     
- Misses      14489    14517      +28     
Components Coverage Δ
datadog-crashtracker 42.47% <ø> (-0.09%) ⬇️
datadog-crashtracker-ffi 6.03% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.32% <75.00%> (-0.30%) ⬇️
data-pipeline-ffi 87.65% <75.00%> (-1.61%) ⬇️
ddcommon 80.07% <ø> (ø)
ddcommon-ffi 68.64% <ø> (ø)
ddtelemetry 60.56% <ø> (ø)
ddtelemetry-ffi 21.32% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.58% <ø> (ø)
datadog-profiling 77.17% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 42.15% <ø> (ø)
datdog-sidecar-ffi 9.05% <ø> (ø)
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.28% <ø> (ø)
🚀 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 30, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 68.04 MB 68.04 MB +0% (+208 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.26 MB 8.26 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 21.15 MB 21.15 MB +0% (+216 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 23.69 MB 23.69 MB +0% (+112 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 74.96 MB 74.96 MB +0% (+104 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.30 MB 8.30 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 16.70 MB 16.70 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 62.62 KB 62.62 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 112.65 MB 112.68 MB +.02% (+32.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 632.41 MB 632.41 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 4.98 MB 4.98 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 62.62 KB 62.62 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 15.85 MB 15.85 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 26.38 MB 26.38 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 14.15 MB 14.15 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 63.58 KB 63.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 114.55 MB 114.55 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 624.68 MB 624.68 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 3.77 MB 3.77 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 63.58 KB 63.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 16.48 MB 16.48 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 24.30 MB 24.30 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 59.31 MB 59.31 MB +0% (+96 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.69 MB 8.69 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 19.47 MB 19.47 MB +0% (+96 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 70.65 MB 70.65 MB +0% (+128 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.70 MB 8.70 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 21.77 MB 21.77 MB +0% (+128 B) 👌

@hoolioh hoolioh force-pushed the julio/catch-panics-trace-exporter branch from 762337a to a4e42c9 Compare May 30, 2025 13:48
@hoolioh hoolioh force-pushed the julio/catch-panics-trace-exporter branch from a4e42c9 to 67006bc Compare June 3, 2025 07:16
@hoolioh hoolioh marked this pull request as ready for review June 3, 2025 07:16
@hoolioh hoolioh requested a review from a team as a code owner June 3, 2025 07:16
@@ -57,6 +59,8 @@ impl Display for ExporterErrorCode {
Self::NetworkUnknown => write!(f, "Unknown network error"),
Self::Serde => write!(f, "Serialization/Deserialization error"),
Self::TimedOut => write!(f, "Operation timed out"),
#[cfg(feature = "catch_panic")]
Self::Panic => write!(f, "Operation panicked"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be returning more information here? Something that would be helpful when these errors wind up in telemetry logs?

macro_rules! gen_error {
($l:expr) => {
Some(Box::new(ExporterError::new($l, &$l.to_string())))
};
}

#[cfg(feature = "catch_panic")]
macro_rules! catch_panic {
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: should this eventually be a proc macro? So we can just do:

#[catch_unwind]
fn foo() {
}

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@ekump ekump left a comment

Choose a reason for hiding this comment

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

LGTM. A couple of ideas that we can talk more about for follow-up but this is a good start.

@gleocadie
Copy link
Contributor

gleocadie commented Jun 5, 2025

Hey nice, that we are going forward that way. I have one question: do we plan to have this for all the ffi APIs ?
I remember months back I brought this idea but at the time, it did not seem a good idea.

($f:expr, $err:expr) => {
match catch_unwind(AssertUnwindSafe(|| $f)) {
Ok(ret) => ret,
Err(_) => $err,
Copy link
Contributor

Choose a reason for hiding this comment

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

You could log the panic here I think so we have more contextual information on what crashed

Suggested change
Err(_) => $err,
Err(panic_info) => {
let msg = if let Some(s) = panic_info.downcast_ref::<&str>() {
Some(s)
} else if let Some(s) = panic_info.downcast_ref::<String>() {
Some(s)
} else {
None
};
if let Some(msg) = msg { ... log the message with error level };
$err
},

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.

7 participants