Speed of the first run

Speed of the first run

von gelöscht -
Anzahl Antworten: 1

Hello everyone,

Unfortunately, I'm still at the beginning of the course... and I ran into a problem. Here are the details:

I installed Julia from ubuntu 20.04 repo:

julia> VERSION
v"1.4.1"

Then I added Julia to my Jupyter (Pkg.add("IJulia")).

Now, when I run any simple command for the first time (println("Hello World")), it takes a few seconds to run and print the answer.

Is it normal? Any suggestion to solve this issue?


Best,

Saeid

Als Antwort auf gelöscht

Re: Speed of the first run

von Antonello Lobianco -
Hello, I would strongly suggest uninstalling the Julia version you installed from the ubuntu repository, it is really, really old.
Rather, just create two subfolders on your home folder, `bin` and `lib` if they don't already exist on your system.
Log out and log in again, Ubuntu will automatically add `~/bin` to your PATH.

Then run this script:
```
cd ~/lib
wget https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.2-linux-x86_64.tar.gz
tar -xzf julia-1.7.2-linux-x86_64.tar.gz
cd ~/bin
ln -s ../lib/julia-1.7.2/bin/julia julia1.7
ln -s julia1.7 julia
```
That is, you create two symlinks, one called `julia1.7` (pointing to the actual executable) and one called `julia` (pointing to your `julia1.7` symlink).
In this way you can have multiple versions of Julia, if you want in the future version 1.7.3, you replace the `julia1.7` symlink to the newer version, when version 1.8 come out you can repeat the process to create the symlink `1.8` and then replace the symlink `julia` and make it pointing to `julia1.8`. So you can have multiple versions if you wish.
There are some tools that automatise this process, but it looks simple enough to just run in from the terminal lächelnd

That said, it may be "normal" that there is a few seconds lag when you run a `println("hello world")` as the first command of your script on Jupyter, as the kernel has to start. But it should be just a few seconds at the beginning of your script, not more than that...