Why Julia is fast in interpreter but slow when dealing with files

I would say startup / initial-compilation-time is slow because there is no way right now to really differ between “I want to run hardcore computations so optimizations are very important and worth doing” and “I want to run an interactive script, running everything interpreted is probably fine”.

On julia 0.7 you can try use julia --compile=no which will run the interpreter (disable any compilation). If you play around a bit in the REPL you can feel that stuff feel very “snappy”. However, any computational heavy code would be very slow. AFAIU the goal is to be able to more dynamically jump between running optimized code and the interpreter to get the best of both worlds.

Another reason for Julia being a bit slow to start is that it right now comes with quite a lot of functionality included. A BLAS system (that has to start a bunch of threads), a Sparse solver that has to be initialized and a few other libraries that all want to do their initialization. Moving to having this as optional “standard libraries” that can easily be disabled, would help.

5 Likes