Many of you are aware that Julia 0.4 has some facilities for precompiling 
modules, but in the last couple of days they have become significantly more 
automated, which should make much faster load times accessible to all your 
users in 0.4.

If your module (and any modules it imports) are safe to precompile, then 
just add:

VERSION >= v"0.4.0-dev+6521" && __precompile__()

at the top of your module file (*before* module ... end), and it will be 
automatically precompiled (to a cached ".ji" file in ~/.julia/lib) the 
first time it is imported.  Thereafter, if any of the dependencies (e.g. 
the included files or imported modules) are updated, it will automatically 
be recompiled the next time it is imported.

See the Julia manual section on modules and precompilation 
<http://docs.julialang.org/en/latest/manual/modules/#module-initialization-and-precompilation>to
 
find out how to make your module safe for precompiling.

(If your module is *not* safe for precompiling yet and you don't have time 
to fix it, use __precompile__(false) to prevent your module from being 
accidentally precompiled, e.g. by being imported into another module that 
is precompiled.)

--SGJ

Reply via email to