Skip to content

Commit 9a23fdf

Browse files
committed
Fewer iterations for debug; more for release.
1 parent 86699a7 commit 9a23fdf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Tests/RealTests/RelaxedArithmeticTests.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ func relaxedSumOfSquares<T: Real>(_ array: [T]) -> T {
3434

3535
// TODO: not a great harness, but making it better bumps up against the
3636
// limitations of what XCT measure { } lets us do easily. Good enough for now.
37-
@_transparent
38-
func benchmarkReduction<T: Real>(_ data: [T], _ reduction: ([T]) -> T) {
39-
var accum: T = 0
40-
for _ in 0 ..< 10_000 {
37+
func benchmarkReduction(_ data: [Float], _ reduction: ([Float]) -> Float) {
38+
var accum: Float = 0
39+
#if DEBUG
40+
let iters = 1_000
41+
#else
42+
let iters = 100_000
43+
#endif
44+
for _ in 0 ..< iters {
4145
accum += reduction(data)
4246
}
4347
blackHole(accum)

0 commit comments

Comments
 (0)