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
[SR-10209] Compile Time Regression with Optimization Enabled #52609
Comments
@eeckstein, aschwaighofer@apple.com (JIRA User), is this the same as the other compile time issues with optimizations on? |
No, this looks like a separate issue. It's a problem in the inliner and in SimplifyCFG. I don't think we saw those problems on other test cases so far. |
Comment by Robbie Trencheny (JIRA) I'm personally seeing compile times run over an hour now when they previously took maybe 20 minutes. I've identified the problem as a third party library for using icon fonts, named Iconic. I've documented my findings thus far here. I also found another project having similar issues, SwiftDate. I can provide a test case from Iconic if necessary. It builds a massive dictionary that maps icon name to unicode character, e.g. UPDATE 1: Looks like this and this may be related. UPDATE 2: Disabling optimization doesn't affect build times. |
Comment by Valentin Pertuisot (JIRA) Hello, I need to add that this issue isn't 5.0 specific, it's Xcode 10.2 specific :
|
"Swift 5.0" refers to the version of the compiler, not the version of the language. Robbie and Valentin, please file your issues separately; until we know that they have the same root cause, it's more useful to be able to investigate them independently. |
Comment by Zhao Wang (JIRA) Hi, I just want to add some information. I am experiencing this issue with my project (it literally stuck and didn't finish for a whole night). The problem happens when I have Swift Compiler -> Optimization Level -> "Optimize for time" selected, which is by default on. If I change to "Optimize for size", then the build process finish quickly. Hope this can be fixed soon. Thanks. |
Hi, Zhao Wang. Same advice to you: please file your bug separately in case it has a different root cause! |
Fixed in #23931 The compile time is still not great, because other optimizations also take time for such huge functions. |
@eeckstein, was this cherry-picked onto 5.1? |
yes |
eskerber (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"? Thanks! |
Comment by Erik Kerber (JIRA) @AnnaZaks It does - the optimized Swift build (from the SHA of the project I originally filed this against) now completes in 34 seconds. |
Great! Thank you for confirming. |
Environment
Xcode 10.2 (10E125)
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Target: x86_64-apple-darwin18.2.0
Additional Detail from JIRA
md5: 649a338e2e34cbfee9dc430aea4138ee
Issue Description:
The open project swift-html-entities contains a file with several extremely large literals defining a Dictionary of [String: Character].
Constants.swift
When building with optimizations enabled (during archiving), the project fails to build for armv7 in a "reasonable" amount of time. In my attempts, I let it run for as much as 560 seconds before terminating the build. The arm64 build finishes in about 30 seconds, still an unusually high amount of time for such a small project.
Using released versions of Xcode/Swift before 10.2 does not result in this behavior, and the archive completes in a few seconds.
The text was updated successfully, but these errors were encountered: