Since I updated to the latest Xcode version 11.0 (11A420a) the debugging is extremely slow and cumbersome.
EDIT: After updating to 11.1 GM (11A1027
Have you tried running Xcode in safe mode? It's not ideal, but this was the only way I could get it to run efficiently. That is until the recent Catalina update where my device is no longer detected in safe mode. So I'm back to square one now.
I had 238 unused breakpoints set. When I deleted them, it's fast again (even with diagnostics turned on.)
I've been dealing with this forever and finally figured it out. It was these lines in my ~/.lldbinit file:
break set -F '-[UIView layoutIfNeeded]' -c '!(BOOL)[NSThread isMainThread]' -L objc
break set -F '-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded]' -c '!(BOOL)[NSThread isMainThread]' -L objc
I commented those lines out and now it's almost as fast as without the debugger!
I've found the same problems in two different cases:
1) the app is not launched by Xcode, i.e. the flag "Wait for executable to be launched" is set inside the Info panel of the Scheme Run settings;
2) the option "Launch due to a background fetch event" is selected in the scheme settings (but this is not the default)
Xcode 11.2.1 (11B500)
In my case (XCode 11.x, MacOS 10.15.2) I've found that the extreme debugger slowness is only triggered if I single-step while another single-step operation is in progress, i.e. I press the step button too quickly. My current workaround is to avoid doing that.
Pure speculation but perhaps it's triggered by XCode/LLDB trying to service multiple breakpoints concurrently? Try removing all breakpoints but one and see if that helps things.
In case it's relevant: I mostly work with C++ in XCode, with a little Obj-C here and there. I don't use Swift at all at present.
I've seen some performance improvements when using the Whole versus Incremental Compilation behavior. Additionally running on Mojave and Catalina should both be showing performance issues. Specifically since the Canvas preview and other new features require more CPU intensity than the last version of Xcode, I would expect Mojave performance to be lower when using Xcode 11 (as it's not optimized for this version of the OS). With Catalina being in Beta, I'd expect to see additional issues as well. I haven't taken specific measures other than the eye-test. The initial run on Whole Compilation is slow but seems to get better thereafter.
Quick help states:
Summary
This setting controls the way the Swift files in a module are rebuilt. * Incremental: Only rebuild the Swift source files in the module that are out of date, running multiple compiler processes as needed. * Whole Module: Always rebuild all Swift source files in the module, in a single compiler process. Declaration
SWIFT_COMPILATION_MODE Value Type
Enumeration (String)