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-6037] [Xcode 9] Compile too slow and re-compile every files #48594
Comments
Thanks for reporting the issue; it's something we know is still a problem. Would you mind attaching your project so that we have another concrete test case to investigate? More examples of real code are always helpful. (If you're worried about posting your code publicly, you can also file a bug report with just Apple at https://bugreport.apple.com.) |
Comment by Nguyen Thanh Hai (JIRA) @@belkadan, thank you for your reply, I have create a problem at https://bugreport.apple.com/web/?problemID=34783005 and also attached full project's source code, hope it can help you. |
Thanks! This is a great test case for us. Meanwhile, we noticed that the project actually compiles much faster under Whole-Module Optimization mode with actual optimization manually turned off. This isn't an officially supported configuration, and it gives up entirely on incremental builds, but there are a number of people who've seen enough improvement to make it worth it. To enable this, set your Optimization Level to "Fast, Whole Module Optimization", but then add "-Onone" to the "Other Swift Flags" build setting in the Debug configuration. |
Comment by Nguyen Thanh Hai (JIRA) @belkadan, 🙁, |
Comment by Nguyen Thanh Hai (JIRA) It still happens on Xcode 9.2, please fix asap |
Comment by Bang Nguyen (JIRA) Seems still happen with my project with Xcode 9.2: change 1 swift file in a framework -> trigger rebuild all source file in dependencies (even just change private function 🙁) |
Bang, any chance you can share your project as well? It's likely a separate issue from Thanh Hai's. |
Comment by Nguyen Thanh Hai (JIRA) @belkadan, do we have any solution for this issue ? The xcode 9.2 took more than 1 hour to compile my project. And it's do it too many times. Please help asap. |
Comment by Bang Nguyen (JIRA) Hi @belkadan, Yes, I generate that project for testing. I have a workspace: TestBreakToSmallProject.xcworkspace, including 2 subprojects: CoreLib and App. App uses the CoreLib. There are 200 swift files in each of CoreLib and App. If I change a swift file in App, incremental build is very fast, ~ 5s. But if I change a swift file in CoreLib (eg. in NothingManager263.swift, rename a private function), incremental build takes 39s (I see Xcode rebuild all swift files in CoreLib and App). Here is my test project: Thanks Bang Nguyen |
Comment by Bang Nguyen (JIRA) OMG, I test and see the WMO and -Onone still can help to speed up swift build in Xcode 9.2!! |
Comment by Nguyen Thanh Hai (JIRA) Hi BangNguyen (JIRA User), @belkadan, I have compared Xcode with Jetbrain's Appcode IDE, there are whats I saw. At the first time I compile the source code the cost to finish is quite same. But other compile later Appcode just re-compile some modified files and/or some related file not re-build all files like Xcode do. My project is now go bigger, I hope Apple will release a better swift compiler soon. |
Comment by Nguyen Thanh Hai (JIRA) hi @belkadan, I have migrated my project's frameworks to Swift 4.1 to compilable in Xcode 9.3 final. There are a little performance issue with closure but it's does not important right now. That's awesome thing I have waiting for a year. Thank you Apple Team. |
Comment by Nguyen Thanh Hai (JIRA) Today I use xcode 9.4.1, I change 1 line in a swift file then xcode compile alot of file same all project Please improve this. |
Does this still happen with the project you attached? What change did you make, so that we can reproduce the problem? |
Comment by Nguyen Thanh Hai (JIRA) @belkadan yes, it still. Project is now bigger then this issue is now more serious. |
Sorry, please include an example of "I changed line X in file Y to 'zzz' and more things recompiled than I expected". |
Comment by Nguyen Thanh Hai (JIRA) I have compiled succeed and ran on a Simulator then I make change on value of a variable: From to private let htmlContainerSuffix = "</textarea>" + Hit run, so a lot of file will be re-compile even al project maybe re-compile. It's take a lot of time for each change sometime the compiler raise a error like missing/too small file, etc... ![](Screen Shot 2018-07-19 at 09.49.24.png) |
Attachment: Download
Additional Detail from JIRA
md5: 7d07dc87f97cf2069847cef5b35d3070
Issue Description:
I was facing with this issue in xcode 8 and now it still happens in the Xcode 9 final with Swift 4.0.
My project write in pure Swift all frameworks are built via Carthage. The compiler take long time at the first compile after clean all previous build.
Sometime, a little change on any file that make Xcode ide re-compile every swift files.
I hope you can show more suggestions in the Xcode that will help us figure out where are the bad swift syntax to improve the compile time.
Thank you Apple 🙂 !
The text was updated successfully, but these errors were encountered: