I want to try the https://jiffyclub.github.io/snakeviz/ SnakeViz Jupyter extension for profiling Python code *right inside the Jupyter notebook*!

- Author: Lilian Besson (@Naereen ;
- License: MIT License ;
- Date: 27-02-2021.

In [3]:

```
!python3 -m pip install snakeviz
```

In [4]:

```
%load_ext snakeviz
```

Let's try it!

In [1]:

```
def carre1(i):
return i**2
N = 10000
```

In [6]:

```
%snakeviz sum(carre1(i) for i in range(N))
```

Let's try this too!

In [7]:

```
%%snakeviz
x = 0
for i in range(N+1):
x += i**2
print(f"Sum i**2 for i=0 to {N} = {x}")
```

I think it's quite useful, and well designed.

It's completely "over kill" for any teaching at bac-2/bac+3 level (in France), but I keep it in mind, in case I need to use it for my own work.