I would like to use Pkg, DrWatson and Pluto notebooks as my main workflow. However I am not able to understand how to effectively use it. Mostly every notebook i open it takes about a min to load libraries. For example during loading a notebook, following codeblock always takes about a min to execute.
begin
@quickactivate "StatisticalRethinkingTuring"
using StatisticalRethinking
end
I was under impression that libraries are slow for the first time, as they are precompiled, following that every load is fast. Indeed the bloack above it
using Pkg, DrWatson
executes in miliseconds. How can I ensure that everytime I load the notebook it does not take minutes to activate and load requirements?
I wonder if the sequence you use to start Pluto might cause this huge difference.
My workflow is as follows:
In Julia 1.6 REPL I activate package mode and update: ] update StatisticalRethinkingTuring.
Typically in a separate Terminal I navigate to .julia/dev/StatisticalRethinkingTuring/notebooks and start Pluto using an alias: alias pluto="clear; j -i -e 'using Pkg; import Pluto; Pluto.run()'"
This alias starts Julia with only preinstalled 4 packages: Pkg, DrWatson, Pluto and PlutoUI.
Aaah, on my system, when it takes that long, in the Terminal where Pluto is started I see many, many messages. I mostly worked in Julia v1.7 until a day or 2 ago. I’ll play around with Julia v1.6.
No issues. I started similar thread (which is linked here too) on how to effectively develop in julia, and this multi second delays in loading libraries etc is one of the major reason I am still not able to give up on python full time.
My sequence for starting Pluto includes
cd into StatisticalRethiningTuring.jl
start Julia REPL
] activate .
using Pluto; Pluto.run()
I have installed Turing in this environment only, ie
] activate .
add Turing
So as to keep environments seperate like in venv python.
Did do a quick check on Julia 1.6 (not sure if Turing is fully tested on 1.7 yet) and get a loading time of about 17s. I do have to add ;dpi = 460 to plot() commands to get reasonable size graphics.
Edited: Had not seen the nice response by @sijo in that thread.