Skip to main content

Practice ยท 1 of 1

Extract the hotspot

Implement hotspot_name(workload): - run workload() under cProfile - inspect the stats programmatically (pstats.Stats(pr).stats) - return the NAME of the function with the highest **tottime** (self time), excluding workload itself The graded workload calls two helpers with very different self-times; the wrong implementation sorts by cumtime and names the wrong thing.

Difficulty: advanced

Back to lesson: Practice: Profiling Practice