Knowledge check¶
Use these questions to check the complete investigate–measure–change workflow. They are included in the final episode’s time.
Questions¶
Why should a correctness oracle be established before benchmarking?
What is the difference between
tottimeandcumtimein acProfilereport?When is
line_profilerpreferable to profiling the whole application again?Name four facts required to make a performance result assessable by another person.
Why should IceCream calls and verbose diagnostics be disabled before a benchmark?
Answers¶
It prevents a faster but changed or wrong result from being accepted and fixes the useful work being compared.
tottimeexcludes subcalls;cumtimeincludes time in the function and its descendants.After function-level evidence has identified a small Python function whose individual lines need investigation.
Any four of: revision/environment, machine or allocation, input/workload, correctness result, timing boundary, warm-up, repetitions, raw samples, statistic, and limitations.
Output and value formatting add work, alter execution, and may disclose sensitive values.