I know that first time a module is loaded in a new session, Julia needs to go through a lot of compiling so it’s slow, and successive loads are much faster. But I read that recent versions of Julia will pre-compile modules and cache them automatically. I believe this means next time loading a module, even for the first time in a new session, should be fast as per-compiled cache will be used, as long as there are no changes to the module and its dependencies.
However, in my experience of JuliaPro 1.01 I noticed only the modules that came with JuliaPro installation (e.g. LinearAlgebra) are super fast to load; anything else still takes quite some time, especially the plotting packages. Since I use quite a few modules including PyPlot in a typical script, it would take well over a minute to load modules in a fresh Julia session.
I know successive runs will be very fast as long as I don’t close the terminal, but when I try to promote Julia to Python and Matlab users, the demo would often be in a fresh terminal; their own test runs would often be in a fresh terminal; when I need to do quick calculations during a discussion with my colleagues, it’ll be in a fresh terminal. It’s embarrassing to have to show an empty terminal for tens of seconds while CPU usage and laptop fan crank up high, after I had claimed to them Julia is super fast.
Are the commonly used big modules really pre-compiled or did I do something wrong? Is there a way to make loading modules fast, even in a fresh session, as long as it has been loaded on the same computer once, and there is no change to it and its dependencies?
Below shows how much time several typical modules take to load in a fresh Julia session on my work laptop (a lousy Intel Core i7-6600U CPU with 8GB RAM, Windows 10 64-bit).
using Revise: 1.385904 seconds (487.14 k allocations: 27.165 MiB, 0.95% gc time)
using LinearAlgebra: 0.963156 seconds (944.32 k allocations: 44.840 MiB, 1.76% gc time)
using Plots: 13.692310 seconds (17.96 M allocations: 949.593 MiB, 7.85% gc time)
gr(): 1.209818 seconds (313.23 k allocations: 15.442 MiB, 3.07% gc time)
using DataFrames: 18.728653 seconds (26.70 M allocations: 1.330 GiB, 5.27% gc time)
using CSV: 21.418905 seconds (25.34 M allocations: 1.193 GiB, 6.11% gc time)
using PyPlot: 41.934533 seconds (41.05 M allocations: 2.514 GiB, 2.79% gc time)