Thank you for your advice. I found some learning material about how to do performance profiing in Python. The cProfile get correct result for me.