Skip to content

Commit 6430525

Browse files
committed
Limit inlining for stdlibunittest. This saves a lot of compilation time
for some of the stdlibunittests. i.e. For the FixPoint benchmark, from 256s on my machine to 27s. rdar://26688483
1 parent 500acb9 commit 6430525

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,12 @@ public final class TestSuite {
11921192
PersistentState.complainIfNothingRuns()
11931193
}
11941194

1195+
// This method is prohibited from inlining because inlining the test harness
1196+
// into the test is not interesting from the runtime performance perspective.
1197+
// And it does not really make the test cases more effectively at testing the
1198+
// optimizer from a correctness prospective. On the contrary, it sometimes
1199+
// severely affects the compile time of the test code.
1200+
@inline(never)
11951201
public func test(
11961202
_ name: String,
11971203
file: String = #file, line: UInt = #line,
@@ -1201,6 +1207,12 @@ public final class TestSuite {
12011207
.code(testFunction)
12021208
}
12031209

1210+
// This method is prohibited from inlining because inlining the test harness
1211+
// into the test is not interesting from the runtime performance perspective.
1212+
// And it does not really make the test cases more effectively at testing the
1213+
// optimizer from a correctness prospective. On the contrary, it sometimes
1214+
// severely affects the compile time of the test code.
1215+
@inline(never)
12041216
public func test(
12051217
_ name: String, file: String = #file, line: UInt = #line
12061218
) -> _TestBuilder {

0 commit comments

Comments
 (0)