Skip to content

Commit 1df944c

Browse files
committed
[benchmark] Fix DataSubscript fragile inlining?
1 parent 928d015 commit 1df944c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

benchmark/single-source/DataBenchmarks.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ public let DataBenchmarks = [
4646
])) } }, tags: d, legacyFactor: 20),
4747

4848
BenchmarkInfo(name: "DataSubscriptSmall",
49-
runFunction: { for _ in 0..<$0*M { blackHole(small[1]) } }, tags: d),
49+
runFunction: { let data = small
50+
for _ in 0..<$0*M { blackHole(data[1]) } }, tags: d),
5051
BenchmarkInfo(name: "DataSubscriptMedium",
51-
runFunction: { for _ in 0..<$0*M { blackHole(medium[521]) } }, tags: d),
52+
runFunction: { let data = medium
53+
for _ in 0..<$0*M { blackHole(data[521]) } }, tags: d),
5254

5355
BenchmarkInfo(name: "DataCountSmall",
5456
runFunction: { count($0*M, data: small) }, tags: d),

0 commit comments

Comments
 (0)