4 ms·
For me the main performance problem with Julia is how long compilation takes. Yes, using it only in conjunction with Jupyter Notebook avoids the issues for the
by alpaca128 7y ago
For me the main performance problem with Julia is how long compilation takes. Yes, using it only in conjunction with Jupyter Notebook avoids the issues for the most part, but writing large programs across multiple files that way is so cumbersome(if even possible) I won't even try.
A program that otherwise takes 4 seconds to compile and run takes 30 seconds when I also let it export a diagram, because each time I run "julia file.jl" it recompiles the plotting library.
If there is a way to have a Julia runtime in the background and letting it execute iterations of the program I haven't found it yet.
- ddragon 7y agoThe easiest solution to have Julia on the background is using Revise.jl. Basically you import your program on the REPL and it will automatically track any change to the source code and precompile and update the environment as soon as you save it (and any function you run on the REPL, including slow to compile such as plotting, will be faster on the second time forward). You can combine it with other useful REPL modules such as Rebugger.jl, OhMyREPL.jl and Infiltrator.jl which you can import automatically in the startup.jl file. The compiler team is prioritizing the compile-time latency and error messages for the 1.4 release, which if they succeed will make the language more approachable for people who use the same workflow as other dynamic languages (running the code from the shell).
- alpaca128 7y agoThanks for the suggestion. The first overhead is even more extreme but afterwards it works pretty smoothly.
- eigenspace 7y agoAnother user suggested Revise.jl, but another option is to just reduce the amount of compilation work you have julia doing if your script isn't crazy performance sensitive. You can play around with command line arguments to julia like `--compile=min`. Here's an example: ~ time julia -e "using Plots; x = 0:0.01:10; plot(x, sin.(x))" real 0m18.050s user 0m17.466s sys 0m0.321s ~ time julia --compile=min -e "using Plots; x = 0:0.01:10; plot(x, sin.(x))" real 0m4.262s user 0m3.706s sys 0m0.263s