Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the ".scatterload" file in macOS?

Tags:

xcode

macos

I've downloaded Apple's TextEdit example app (here) and I'm a bit puzzled by one thing I see there: the TextEdit.scatterload file. It contains a list of functions and methods. My guess is that it provides information to the linker as to which functions/methods will be needed, and in what order, when the app launches, and that this is used to order the binary generated by the linker for maximum efficiency. Oddly, I seem to be unable to find any information whatsoever about this file through Google. So. First of all, is my guess as to the function of this file correct? And second, if so, can I generate a .scatterload file for my own macOS app, to make it launch faster? How would I do that? Seems like a good idea! (I am using Objective-C, but perhaps this question is not specific to that, so I'm not going to tag for it here.)

like image 946
bhaller Avatar asked Feb 01 '26 14:02

bhaller


1 Answers

Scatter loading refers to a way to organize the mapping of your code in memory by specifying which part of code must be near which one, etc. This is to optimize page faults, etc. You can read about it here Improving locality of reference (HTML) or here Improving locality of reference (PDF).

.scatterload file is used by the linker to position code in memory layout of the executable.

Except if your app really need tight performance tuning, I would not encourage you to have a look at this.

like image 73
Jean-Baptiste Yunès Avatar answered Feb 03 '26 09:02

Jean-Baptiste Yunès



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!