Skip to content

Commit d9457ea

Browse files
committed
feat: reduce warmup time to avoid long benchmark times
1 parent d8b88b1 commit d9457ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

testing/patches/benchmark.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ index 882859b..668e674 100644
181181
} else {
182182
- d := b.benchTime.d
183183
- for n := int64(1); !b.failed && b.duration < d && n < 1e9; {
184-
+ warmupD := time.Millisecond * 500
184+
+ warmupD := b.benchTime.d / 10
185185
+ warmupN := int64(1)
186186
+ for n := int64(1); !b.failed && b.duration < warmupD && n < 1e9; {
187187
last := n

testing/testing/benchmark.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (b *B) launch() {
425425
b.runN(b.benchTime.n)
426426
}
427427
} else {
428-
warmupD := time.Millisecond * 500
428+
warmupD := b.benchTime.d / 10
429429
warmupN := int64(1)
430430
for n := int64(1); !b.failed && b.duration < warmupD && n < 1e9; {
431431
last := n

0 commit comments

Comments
 (0)