I'm running macOS Catalina 10.15.4 on a 2018 MacBook Pro 15", which has the T2 chip (if anything else is relevant, let me know and I'll update the question.)
I'm a developer and I'm in the process of writing and debugging a C command-line utility that's supposed to take a few miliseconds to run and exit.
My internet connection went down while I was coding (WiFi was still connected, but my ISP was down), and afterwards I noticed that, after compiling the app, the first time I ran it, it took a few seconds to run rather than the expected fraction of a second.
I turned off WiFi (so there was no active network connection), compiled my app again, and ran it -- this time it ran as quick as I would expect.
Turn on WiFi, compile and run again, first run of the app takes longer than expected.
Maybe I'm paranoid, but it sure sounds like macOS is trying to ask Apple's servers for blessing to run my app. Is this the case, or could there be another explanation? If it's indeed the case, can anyone link to an article explaining what's going on under the hood?
UPDATE: as requested, here are timings for an average of three runs of the following command, under different conditions:
touch file.c && make && time ./file && time ./file
The first measurement is the average time for running file
for the first time after compilation (the third command in the chain). The second measurement is the average time for running file
for the second time after compilation (the fourth command in the chain).
WiFi on, with internet: 347 ms/3 ms.
WiFi on, without internet: 5024 ms/3 ms.
All network connections offline: 24 ms/2 ms.