3 ms·
Xcode with Swift is a bit odd in that its performance varies greatly depending on project structure and as nonintuitive as it may be, the way the developer writ
by kitsunesoba 6y ago
Xcode with Swift is a bit odd in that its performance varies greatly depending on project structure and as nonintuitive as it may be, the way the developer writes code.
For instance a sprawling project with an even split of Objective-C and Swift that constantly call into each other can bring SourceKit to its knees, as can some CocoaPods setups. Going Swift-only or even just reducing the surface between Objective-C and Swift to the absolute bare minimum can speed things up a lot.
As for writing style, there's a few things that can trip SourceKit up but I've found that the main things to avoid are chaining optionals too deeply and nesting closures too deeply (recommend keeping both to 2-3 tops) as well as casting to/from Any too often.
- oblio 6y agoTo summarize, this is the most Apple of arguments, that you're making: "You're holding it wrong."
- doctor_eval 6y agoI think the parent was just trying to help. I’ve had similar problems with IngelliJ when I had the wrong project view open.
- josephg 6y agoYeah its 2021. There's no excuse for shipping software you know crashes every few hours of normal use. Or lags so badly you can't type sometimes. I doubt XCode in its current form would make it through Apple's own app store review process. Fix your software or replace your staff with people who can. I choose to abandon programming for Apple's devices entirely rather than put up with xcode.
- dwaite 6y agoNot quite - the origin of "You're holding it wrong" was a response to someone who was quite literally trying to illustrate the cellular signal attenuation issue by pressing down with their fingers on the gap between the two antennas. I believe the parent was saying that the performance of xcode varies based on the project. This is true - breaking projects up into more modular setups has long optimized project build speeds. The quality you get out of your tools is in many cases based on how you use them. "You're holding it wrong" would apply if you were deliberately using the tools in a sub-optimal way to try to prove a point.
- jamil7 6y agoI’ve noticed similar issues, it’s especially a problem with SwiftUI as nesting closures often feels natural there, my brand new M1 mini will still give me the “expression too complex” error on larger SwiftUI components.