October 2025
Intermediate to advanced
485 pages
13h 2m
English
While benchmarking at its core is a simple idea, a surprising number of gotchas can completely derail your experiments. These gotchas are particularly sneaky since timeit will always spit out a number even if your experiment isn’t set up correctly. Everything may seem to be in order, but your results may be totally meaningless. We’ll look at these gotchas throughout the remainder of this chapter.
One of the most important things to keep in mind when benchmarking, or when conducting any scientific experiment for that matter, is to ensure that your experiment is controlled. This means that if you’re comparing two different algorithms, all other factors besides the algorithms themselves ...
Read now
Unlock full access