[SR-4430] Extremely slow Dictionary literal compilation in Swift 3.1 #47007
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
performance
type checker
Area → compiler: Semantic analysis
Environment
Swift 3.1
Xcode 10.3
MacOS 10.12.4 (16E195)
Additional Detail from JIRA
md5: dbda91eab7f9b5464c8e7ffbfdeb08b5
Issue Description:
Starting with Xcode 10.3 and Swift 3.1 we have an extremely huge increase in our compilation time. We tracked down the issue to be compiling Dictionary literals that have multiple nested levels.
Example:
Some observations:
The above code compiles in almost 3 minutes in Xcode 10.3 and in 27 seconds in Xcode 10.2.1. That is a 650% increase.
Adding top level keys to a 2 level nested dictionary slows compilation down
Defining types and not having them inferred speeds up the compiler only if the dictionary literal is not too complex, not in the case above.
If I change a single line in a totally unrelated file under the same module (incremental build) the Dictionary is compiled again. This is so annoying that you can barely work with Xcode anymore.
The text was updated successfully, but these errors were encountered: