Using the profile
module provided by Python it is extremely easy to perform profiling of a command:
Result:
However, interpreting these results correctly may not be trivial. How to interpret the results in general is explained at The Python Profilers .