Skip to content

Commit 0bb0a9a

Browse files
committed
Only run benchmarks in Release, they're meaningless in Debug.
1 parent 93e5499 commit 0bb0a9a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Tests/RealTests/RelaxedArithmeticTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import _TestSupport
1616
import Accelerate
1717
#endif
1818

19+
#if !DEBUG
1920
func strictSum<T: Real>(_ array: [T]) -> T {
2021
array.reduce(0, +)
2122
}
@@ -36,11 +37,7 @@ func relaxedSumOfSquares<T: Real>(_ array: [T]) -> T {
3637
// limitations of what XCT measure { } lets us do easily. Good enough for now.
3738
func benchmarkReduction(_ data: [Float], _ reduction: ([Float]) -> Float) {
3839
var accum: Float = 0
39-
#if DEBUG
40-
let iters = 1_000
41-
#else
4240
let iters = 100_000
43-
#endif
4441
for _ in 0 ..< iters {
4542
accum += reduction(data)
4643
}
@@ -129,3 +126,4 @@ final class RelaxedArithmeticTests: XCTestCase {
129126
#endif
130127
}
131128
}
129+
#endif

0 commit comments

Comments
 (0)