You can pass Julia code to
Do I have it correct that the first option only stores type inference in the sysimage, and not generated machine code, while using
script stores both?
If so, what’s the use of
precompile_execution_file; why would anyone not always use
All variants compile machine code instructions.
precompile_* are used to create a file that is executed to output the object file.
If you provide a
precompile_executation_file that will actually be converted into precompile statements either way. The precompile statements are then wrapped with some Julia code.
(See here. )
The script is just some plain Julia code you can append to the executed Julia code. This way you essentially skip all the smart things PackageCompiler does. (See here.)
I am not sure what the script is for, but from the source code, it seems like one shouldn’t use it if there is no reason for it. Like it could for example add more things to the sysimage than wanted.
Interesting, thank you.
So there is a difference in what
precompile does in a normal Julia session  and in one with
 Namely only type inference, not generate machine code, as explained at
https://timholy.github.io/SnoopCompile.jl/stable/#Background (Unless I misunderstand that text).
Yes, I think the link you shared explains the difference well.