I have seen that, every time I restarted Julia, the first execution of a function in a package is somewhat slow, and the others are pretty fast. I understand that this is Julia compiling the code.
I do not understand those things about compilers and JITs and etc., but I am wondering: if the package did not change since the last execution, why this “compiled” version cannot be stored so that we do not have the overhead in the first call? I though that the __precompile__() directive was doing this.
For now, “precompiled” packages are not stored as machine code and so still suffer from some compilation overhead when you actually execute a function. The plan is to move closer to native code (what I think you are suggesting) to avoid this in the future: see issue 27362.