Profiling

In order to check which part of your code is more greedy, you can run

sudo perf top -p <PID>