10.12 Sierra: Apps take 30s to launch when they took 2s in 10.11

Originator:tempelmann
Number:rdar://27549820 Date Originated:26-Jul-2016 08:09 PM
Status:duplicate of 27287483 Resolved:fixed in 10.12 beta 3
Product:OSX Product Version:10.12 (16A254g)
Classification:Performance Reproducible:Always
 
Summary:
(To clarify, 30s means 30 seconds)

Apps with a lot of internal dylibs now take very long to launch at the first time after reboot, or even after waiting a while without rebooting. The same apps start within a few seconds on previous OSX systems.

Steps to Reproduce:
1. Download any of these OSX apps, they're all zipped plain app bundles:
http://apps.tempel.org
I suggest the Prefs Editor, but they all show the same behavior.

2. After downloading, Safari will probably unzip the app so that it is now in the Downloads folder.

3. Launch the app. This will take a long time due to it being first verified and then being translocated to a random tmp folder.

4. Once the app is fully launched, enter this Terminal command to check where the app is running from:
  lsof | grep -m1 "Prefs Editor"
This should list the path at which the app is currently loaded.
The path will not be the one in the Downloads folder but in a temp random folder. This is due to "app translocation" and is expected in 10.12.

5. Quit and launch the app again. It will probably start quickly this time, but if you issue the same Terminal command, you'll see that it's still running from a temp folder.

6. Quit the app, move it to the Applications folder and launch it again. Check its location with the Terminal cmd and see that it's not in a randomized tmp folder any more but in the /Applications folder. This is also expected - once a downloaded and unzipped app gets moved from its original folder, it should not get translocated any more.

However, what's unexpected is that the launch took quite long again (nearly 30s in my case, running from an internal hard disk).

7. Restart the Mac

8. Relaunch the app from the Applications folder. Again, it will take a long time to launch, I even see the beachball during launch. This should not be the case at this point.

9. Now, if you, like me, have another system partition, running 10.11.5, boot into that and then launch the same Prefs Editor app again. It should launch within a few seconds (2s for me). This proves that it's not a slow disk causing the slow launch but the 10.12 system software is responsible for it.


Expected Results:


Actual Results:


Version:
10.12 beta 16A254g

Notes:
I also noticed that the app (and even all its containing files and folders) had the quarantine flag still set. But removing them did not help make the launch go fast in 10.12. (I'll file a separate report about that.)

So, something else besides the quarantining and the translocation is causing the slow launch of these apps. And I'm not alone with this. It's pretty clear that any apps made with Xojo (Realbasic) suffer from this, probably because of their large amount of internal dylibs that get loaded along.

Also, if the app was launched (slowly) once, it will launch quickly after that, at least for a while. So it's certainly possible for 10.12 to launch the apps as fast as it was possible on 10.11 - but something goes wrong and makes them launch slowly again later. And that's probably either a bug or a design flaw. It hope it's the former.

This needs fixing, 30s launch times are unacceptable when they were 2s in previous OS X versions.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!