How to use Pluto with DrWatson effectively?

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.

	@quickactivate "StatisticalRethinkingTuring"
	using StatisticalRethinking

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?


Apologies, I’d missed your post.

On my system I see 160ms for using Pkg, DrWatson and 26s for

	@quickactivate "StatisticalRethinkingTuring"
	using Turing 
	using StatisticalRethinking

I wonder if the sequence you use to start Pluto might cause this huge difference.

My workflow is as follows:

  1. In Julia 1.6 REPL I activate package mode and update: ] update StatisticalRethinkingTuring.
  2. 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;'"

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

  1. cd into StatisticalRethiningTuring.jl
  2. start Julia REPL
  3. ] activate .
  4. using Pluto;

I have installed Turing in this environment only, ie

  1. ] activate .
  2. 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 @sudete in that thread.