macOS 10.15: slow by design

Apparently, Apple is making macOS Catalina phone home so much it’s making the operating system slow, laggy, and beachbally, as Allan Odgaard details.

Apple has introduced notarization, setting aside the inconvenience this brings to us developers, it also results in a degraded user experience, as the first time a user runs a new executable, Apple delays execution while waiting for a reply from their server. This check for me takes close to a second.

This is not just for files downloaded from the internet, nor is it only when you launch them via Finder, this is everything. So even if you write a one line shell script and run it in a terminal, you will get a delay!

Aside from the obviously terrible design and privacy implications of your computer phoning home to Apple every time you execute something, this is also another case of Apple only designing for the absolutely optimal use-cases – i.e., people working and living in Cupertino – and that’s it. The less optimal your internet connection or the farther away you are, the worse your experience will be.

Apple has a few file system locations that require user permission to access them, for example ~/Desktop, ~/Documents, and ~/Downloads.

Surprisingly though, just obtaining the display name or icon for one of these folders will trigger Apple’s code to verify that the client is allowed to access the location.

This is done by sending a message to the sandboxd process which sends a message to tccd which calls SecCodeCheckValidityWithErrors and seems to communicate with yet another process, but I can’t find which, and this takes around 150 ms per location.

It may not seem like much, but this adds up, and can add more than half a second of delay when opening an application.

Like with privileged folders, keychain items also require permission for applications to access them.

But again, something is wrong. Specifically calling SecKeychainFindGenericPassword can cause noticeable delays, on a bad internet day I had this call stall for 3.3 seconds and this was with System Integrity Protection disabled!

And on other delays in launching applications in general:

This is the worst issue, sometimes, things will stall for 5-30 seconds.

Mostly though it is when launching applications. Sampling the application during launch shows stalls in ImageLoaderMachO::loadCodeSignature, SLSMainConnectionID, and many references to Skylight and CGS in the stack trace.

The current best way to “address” this issue is disabling System Integrity Protection and disconnecting from the internet (!), and especially that second one is of course entirely unreasonable. I wouldn’t touch macOS with a ten-foot pole even before Catalina – it always felt slow and sluggish to me, even on faster Macs, and Mac hardware is terrible value right now – but with all the general complaints about Catalina, and now this, it’s getting ever clearer I’m not missing out on anything by sticking to Linux.

At least my computer isn’t calling home to Clement Lefebvre every time I run a tiny script.

48 Comments

  1. 2020-05-22 10:15 pm
    • 2020-05-23 12:36 am
      • 2020-05-23 6:59 am
        • 2020-05-23 11:38 am
        • 2020-05-23 12:21 pm
      • 2020-05-23 11:48 am
        • 2020-05-23 1:50 pm
    • 2020-05-24 12:07 am
      • 2020-05-24 8:54 am
        • 2020-05-26 12:04 am
  2. 2020-05-22 10:47 pm
    • 2020-05-23 1:05 am
  3. 2020-05-22 11:42 pm
  4. 2020-05-23 4:37 am
  5. 2020-05-23 6:29 am
    • 2020-05-23 1:54 pm
    • 2020-05-23 2:29 pm
      • 2020-05-23 3:14 pm
  6. 2020-05-23 7:03 am
    • 2020-05-25 5:27 am
    • 2020-05-25 2:51 pm
      • 2020-05-25 5:05 pm
  7. 2020-05-23 7:55 am
    • 2020-05-23 10:08 am
      • 2020-05-23 11:52 am
        • 2020-05-23 10:34 pm
          • 2020-05-25 5:39 am
        • 2020-05-24 3:39 pm
  8. 2020-05-23 2:14 pm
  9. 2020-05-23 6:58 pm
  10. 2020-05-23 7:54 pm
  11. 2020-05-23 10:36 pm
    • 2020-05-24 12:04 am
      • 2020-05-24 1:20 am
    • 2020-05-24 12:06 am
  12. 2020-05-24 7:52 am
  13. 2020-05-24 6:24 pm
  14. 2020-05-25 8:34 am
    • 2020-05-25 10:22 am
    • 2020-05-25 6:52 pm
      • 2020-05-25 8:15 pm
  15. 2020-05-25 1:27 pm
  16. 2020-05-25 1:34 pm
  17. 2020-05-26 7:40 am
  18. 2020-05-26 7:48 am
    • 2020-05-26 11:59 am
  19. 2020-05-26 2:58 pm
  20. 2020-05-28 2:20 pm