Slow Jupyter with Julia

When I run something simple like 1+1 in Jupyter using Julia, it is significantly slower than when I do the same thing with Python. How come? And is there a faster way to use Julia in Jupyter?

Just the first time (after you started the notebook / the kernel) or always?

1 Like

You’re just looking at startup time — Julia compiles a bunch of stuff the first time you run anything. After that it should be roughly the same speed (because the time to execute something trivial like 1+1 in Jupyter is dominated by the communication and front-end).

In general, loading new packages, and running a function for the first time in those packages, takes longer in Julia because of the time to compile things. (This will continue to get better over time, e.g. as Julia caches more compiled code and other strategies … search for “time to first plot” for lots of discussion.) But once that is done, things can run much more quickly, which is the main point of interest for large computations. See e.g. this blog post: Mythbusting Julia speed

1 Like

Just the first time. Works similarly fast to Python after that. I noticed it also on one of the video tutorials for the language, where the tutor’s Jupyter seemed to run slowly - I guess she too was starting it up.