Skip to content

Conversation

@DougGregor
Copy link
Member

@DougGregor DougGregor commented Jul 10, 2017

Explanation: Typo correction can be expensive, because it walks fairly large data structures (both in-memory and on-disk) and does a bunch of work. Limit the number of times a particular Swift invocation will perform typo correction (to 10, with a flag to change the limit). Clang has done this "forever" and it's helpful there.
Scope: Typically only affects "very broken" code, e.g., where one has pasted a bunch of code and forgotten an "import". But when it happens, the Swift type checker gets very slow and eats up a lot of memory.
Radar: rdar://problem/28469270
Risk: Very low; limits existing behavior on code that produces > 10 typo correct diagnostics.
Testing: Compiler regression testing

Typo correction can be particularly expensive, so introduce a
command-line flag to limit the number of typo corrections we will
perform per type-checker instance. Default this limit to 10.

Addresses rdar://problem/28469270 to some extent.

(cherry picked from commit f03685b)
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit a3e546c into swiftlang:swift-4.0-branch Jul 11, 2017
@DougGregor DougGregor deleted the limit-typo-correction-4.0 branch July 11, 2017 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants