Understanding Python profile output

后端 未结 6 547
长情又很酷
长情又很酷 2021-01-02 17:39

I\'m trying to use the Python profiler to speed up my code. I\'ve been able to identify the specific function where nearly all of the time is spent, but I can\'t figure out

6条回答
  •  孤城傲影
    2021-01-02 18:15

    Yeah I came across that same problem as well.

    The only way I know to work around this is to wrap your large function into several smaller function calls. This will allow the profiler to take into account each of the smaller function calls.

    Interesting enough, the process of doing this (for me, anyway) made it obvious where the inefficiencies were, so I didn't even have to run the profiler.

提交回复
热议问题