You can get definitive answer by using a Python profiler, but a likely root cause is excessive logging. See more details here: