Skip to content

Limit inlining for stdlibunittest. This saves a lot of compilation time #2975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,12 @@ public final class TestSuite {
PersistentState.complainIfNothingRuns()
}

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

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