Analyze and Compare Measurements Using Statistics
Despite our best efforts to isolate our code from external factors, there will still be a variation in our measurements when we run the same code over and over again. Most of the time this won’t bother us. For example, if our code takes from 10 to 15 seconds before optimization and from 1 to 2 seconds after, we won’t need any statistics to tell us that our optimization worked.
But sometimes things do not look as certain. For example, say we optimized the code and the execution time went down from the 120--150 ms range to the 110--130 ms range. How can we be sure that the perceived optimization of 10--20 ms is the result of our change and not some random factor?
To answer such questions, we’ll ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access