Julia static compilation

I’m specifically interested in the static compile with minimal runtime usecase. Anyone have any idea how far out that is? 1.0 or post 1.0?

for 3) I have created an issue here:

  1. is actually a pretty nature thing in context of package precompilation, see:
1 Like

Ability to make proprietary packages is absolutely mandatory for further language adaptation.

1 Like

While I personally tend to agree with you on some level, can we please make an effort in keeping the tone appropriate for a scientific community and phrase opinions for what they are, opinions, instead of making claims with absolute certainty that no un-clairvoyant being has any business making.


My use case is to run a julia script and exit in under 2 seconds.
My experiments with a fairly simple script[1] is that it takes between 1.5 and 3 seconds.
Is there any way to use any pre-compilation to make this runtimes more consistent?

[1] It just reads a 19K JSON file and writes out a one line file.


That might be related to the slow startup time of Julia compared to e.g. Python

time julia -e ""
real    0m0.323s
user    0m0.356s
sys     0m0.720s

 time python -c ""

real    0m0.018s
user    0m0.012s
sys     0m0.004s

I don’t think static compilation will make startup time any faster.

I just tried to compile the following program with BuildExecutable.jl and julia 0.5 (0.6 failed):

main() = begin end;
$ time ./test_exec/test_exec 

real	0m0.285s
user	0m0.212s
sys	0m0.096s

the same as:

$ time julia-0.5 -e "main()=begin end;main();"

real	0m0.268s
user	0m0.220s
sys	0m0.072s

both runs oscillate around 270ms
julia 0.6 is a little bit faster ~240ms

$ time julia-0.6 -e "main()=begin end;main();"

real	0m0.236s
user	0m0.180s
sys	0m0.072s

but doesn’t beat 0.4:

$ time julia-0.4 -e "main()=begin end;main();"

real	0m0.162s
user	0m0.116s
sys	0m0.064s

What is the dominant cost of startup (assuming there is a single dominant cost)?

Is there any update on this? I’m thinking about implementing some of my current project in Cython, but I would love it if I could use Julia instead. But I need to integrate whatever I do into Python seemlessly (from a user perspective, I’d like them to not know Julia is even there!)

There have been some successful uses of https://github.com/JuliaComputing/static-julia

6 posts were split to a new topic: Reluctance to switch to Julia; PyPy and Cython

The current state of this work is at https://github.com/JuliaLang/PackageCompiler.jl


One of the arguments for static compilation seems to be the commercial code and obfuscation argument.

I throw it open for discussion - when commercial Julia codes are being sold, will it be important to have obfuscated code? I do not have the answer.
I am assuming here there are no commercial Julia codes being sold at the moment. There may well be!

An important question, but please consider opening a new topic.

New topic Commercial codes using Julia - code obfuscation?

1 Like

Having the ability to create C Compatible Dynamic / Static Library from Julai Function would be amazing!

Making all the development in Julia, including the Unit Tests and then producing Dynamic / Static Library (With corresponding h File on all OS’s) would be a killer feature.

Many companies I know use MATLAB to do just that.
The Signal Processing Algorithm team does all the development on MATLAB then create a generated Code (Or Library) which is compiled with the whole project (Developed by the software team).
If Julia can generate much more efficient Compiled Library which has superior performance it will make a big step forward for those teams.

I understand it will come later on (Which is logical) yet I hope not too far in the future.
Is it realistic to have such feature within 2019?


It would be nice to get grant from governements because more code could consume less energy and it could help prevent climate change! :wink:

Any process on this feature ? It’s an excited feature. I expect somthing like “julia -c myscript.jl -o myapp.exe”


Yes, PackageCompiler offers this!