Skip to content

Commit 913943e

Browse files
authored
chore: Increase benchmark warning threshold for trial decrypt (AztecProtocol#3602)
Trial decrypt measurements have a lot of variance, and often fire as false positives. This increases the warning threshold for note decrypt specifically to 75% to reduce noise.
1 parent 8c759f6 commit 913943e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yarn-project/scripts/src/benchmarks/markdown.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const WARNING_DIFF_THRESHOLD = 15;
2121
const SMALL_MS_THRESHOLD = 200;
2222
// What % diff should be considered as a warning for "small" ms measurements
2323
const WARNING_DIFF_THRESHOLD_SMALL_MS = 30;
24+
// What % diff should be considered as a warning for trial_decryption in particular
25+
const WARNING_DIFF_THRESHOLD_TRIAL_DECRYPTION = 75;
2426

2527
const log = createConsoleLogger();
2628

@@ -30,7 +32,9 @@ function isWarning(row: string, col: string, value: number, base: number | undef
3032
return false;
3133
}
3234
const absPercentDiff = Math.abs(Math.round(((value - base) / base) * 100));
33-
if ((row.endsWith('_ms') || col.endsWith('_ms')) && value < SMALL_MS_THRESHOLD) {
35+
if (row.includes('trial_decrypt') || col.includes('trial_decrypt')) {
36+
return absPercentDiff > WARNING_DIFF_THRESHOLD_TRIAL_DECRYPTION;
37+
} else if ((row.endsWith('_ms') || col.endsWith('_ms')) && value < SMALL_MS_THRESHOLD) {
3438
return absPercentDiff >= WARNING_DIFF_THRESHOLD_SMALL_MS;
3539
} else {
3640
return absPercentDiff > WARNING_DIFF_THRESHOLD;

0 commit comments

Comments
 (0)