macos wakes up from sleep very slowly when internet connection is also slow [duplicate]

I'm a software developer and as such I build and run programs hundreds of times per day. I've noticed that since I started using Catalina, after compiling and linking there is a delay (which can be seconds) when the internet is slow or having problems (I have bad internet often). If I disable wifi and rebuild, the delay goes away.

How can I disable this so my builds run faster?


Yes, as a security measure, macOS Catalina sends some small info (can be seen by packet size) about unsigned executables to the Apple servers.

A simple C program as illustrated in ..

  • Does macOS phone home to Apple's servers before running an app for the first time?

.. can demonstrate the lag in startup on poor internet connection conditions.

  • https://lapcatsoftware.com/articles/catalina-executables.html

The article has detailed observations, tests and commentary on the process.

You can block the syspolicyd process from connecting to the internet, and it won't hinder its normal functioning locally, using a firewall.

I use LuLu, since it's free. A lot of people use Little Snitch.

  • https://github.com/objective-see/LuLu
  • https://www.obdev.at/products/littlesnitch/index.html

Many other apps also ping their servers on startup or quitting: Firefox, Adobe, Sublime Text etc.

Other threads:

  • Which free alternatives to Little Snitch can I use to block internet traffic per applications?
  • How can I get the exact URLs/requests that a program is trying to connect to?
  • Reasons to prefer Little Snitch over the built-in firewall
  • Firewall for outgoing connections

Use an Application Firewall to control what app on your mac connects to the internet.

Lulu is free and opensource. Radiosilence and TripMode are two other very affordable alternative app firewalls that are simpler to use than Lulu. Little Snitch and HandsOff are more advanced with more features (and hence costlier).

If you like controlling what apps connect to the internet on your mac,think carefully before upgrading to macOS Big Sur. Apple has crippled application firewalls on macOS Big Sur, to specifically allow all Apple authorised software to bypass application firewalls and some VPNs, and connect to the internet whenever it wants even if you have blocked them on your firewall.

Update: Apple claimed that the issue with macOS Big Sur was a bug and it has been fixed now.