Is it possible to precompile a function in Julia?

  1. Precompilation only speeds up code loading (i.e. startup time), not runtime performance. All Julia functions are compiled the first time you call them (with a particular set of argument types), and thereafter are fast.

  2. Precompilation is something that happens for code that you put into a package, which you should do for any longer-term development effort in Julia. See also Best practise: organising code in Julia - #2 by stevengj

3 Likes