Can someone actually explain me what dyld_shared_cache_x86_64 and other files located at /System/Library/dyld are? I know that dyld is the dynamic libraries loader which recursively load required dylib into memory for every launched process but i still dont get what dyld_cache and aot_cache exactly are? I'm looking to a detailed explanation about those.
On macOS the exact nature of the dyld
shared cache has changed over time. Unless otherwise stated, the following assumes macOS 11.
The dyld
shared cache is slightly misnamed because it’s not actually a cache [1]. Rather, it’s part of macOS’s mastering process. When Apple builds macOS we take all the commonly-used dynamic libraries and pre-link them together into a single shared file. This allows for many optimisations that improve app startup time.
The AOT cache relates to dyld
3’s closure formation.
For a bunch of backstory here, see WWDC 2017 Session 413 App Startup Time: Past, Present, and Future.
IMPORTANT This stuff is all implementation detail. It has changed radically in the past and it’s likely to change again in the future (indeed, macOS 12 beta has dyld
4, with even more changes). Based on your other thread it sounds like you plan to create a product around this, and that’s not something we’d support.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] It was back in the day but that’s no longer true.