Zmierz czas na linię Python
$ pip3 install line_profiler
@profile
def slow_function(a, b, c):
...
$ kernprof -l script_to_profile.py
$ python -m line_profiler script_to_profile.py.lprof
Jolly Jellyfish