Jump to content
Brandon Staggs

MacOS Debugging suddenly became excruciatingly slow

Recommended Posts

I am hoping someone else has experienced this and can share a solution.

 

Last week my debugging MacOS applications through PAServer became extremely slow. Code executes but (apparently) the communication between the debugging process on the Mac and on the Windows PC is so slow as to be unusable. If I detach from the process the application will suddenly start running at normal speeds. No breakpoints are needed for this problem to happen, just the act of running it with the debugger attached slows everything down to an unusable speed. 

 

It is possible, but I do not know if this timing is correct, that this happened after updating the Mac to Sequoia 15.4. The Mac is an M2 Pro model with a 2.5 gig wired ethernet connection (wifi disabled). Deploying to the Mac is super fast from Delphi. It's not a network speed issue.

 

I have already tried updating XCode and updating the SDK profile in Delphi.

 

Details:

 

Apple M2 Pro, Sequoia 15.4

Wired ethernet (2.5 gig), deployment speed is very very fast even for large transfers.

Delphi 12.2.

Target: MacOSX ARM 64 bit, SDK 15.4. 

 

Does anyone who debugs MacOS FMX applications have any suggestions on what might be suddenly slowing down the debug process? I can confirm that code is running and I can step through it, it's just SUPER slow to do so, the main form takes several minutes to appear (but eventually does), after which it remains ultra-slow.

Edited by Brandon Staggs
  • Like 1

Share this post


Link to post

I'm afraid I can't add anything really helpful, but for me debugging and deploying has been painfully slow for a long time now. But that might very well be caused by the IDE running in a VM and debugging in a macOS VM with both running on the same machine. So a minute and more for deployment and the GUI to show up, even for a trivial project is the norm. But even once it runs, stepping through the code is painfully slow and I do get timeouts etc. from time to time.

 

Have you tried debugging something trivial with Xcode to see if the debugging in general is affected?

 

If you're suspecting the Sequoia update, one option would be to prove that with a VM and debug in there before and after updating Sequoia. If your virtualisation app cannot do macOS VMs on Apple Silicon, I can recommend VirtualBuddy.

 

 

Share this post


Link to post

I'm developing on real hardware. As far as I know there is no legitimate way to run MacOS in a VM, but my information may be outdated.

 

I switched to using a much older Intel MacBook Pro with an older OS, and debugging speed is acceptable on that. I do suspect the OS update.

 

Before this began, debugging and stepping through ARM64 code on the Mac was actually quicker than stepping through Win64 code on the same PC as the Delphi IDE, which I always found ironic.

 

I tried debugging other code on the M2 and all of it was extremely slow.

Share this post


Link to post
36 minutes ago, Brandon Staggs said:

I'm developing on real hardware. As far as I know there is no legitimate way to run MacOS in a VM, but my information may be outdated.

Yes that info is outdated. Apple is providing and updating its own virtualisation framework for a couple of years now and the linked VirtualBuddy app is using that and "just" provides a GUI around it. FWIW also other tools like Parallels make use of that framework (sometimes as an alternative, sometimes, like macOS ARM guest on a macOS ARM host, it's the only available way). The problem is that the virtualisation framework is still quite limited, i.e. you still can't route USB devices into the virtual machine. That's a showstopper for me, so I'm stuck on Intel hardware for now, when it comes to debugging a macOS app and I need USB hardware.

 

36 minutes ago, Brandon Staggs said:

I tried debugging other code on the M2 and all of it was extremely slow.

Other Delphi code or some sample in Xcode?

 

This could still be some network thing. But good luck finding something there - google is full of network issues in Sequoia.

Share this post


Link to post
2 hours ago, msohn said:

Other Delphi code or some sample in Xcode?

 

This could still be some network thing. But good luck finding something there - google is full of network issues in Sequoia.

Other Delphi code.

 

I updated the Mac from 15.3 to 15.4. Sequoia 15.3 was working fine, but I am not 100% sure that this issue coincided with the update.

 

PAServer is deploying over 150 megs of binaries (the app and a bunch of dylibs) in just a few seconds; I use a 2.5 gig wired network connection for this and disable wifi so that PAServer doesn't try to use a slow connection. If there are network issues it's not due to speed but could still be other problems. I will look into that.

 

I am also wondering if upgrading to Delphi 12.3 with the updated PAServer will matter. That's kind of a last resort at this point and seems very unlikely to make a difference.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×