June 2023
Intermediate to advanced
356 pages
5h 32m
English
Here’s a profile for a program that took almost 22 hours to run:
| Duration | ||||
| Subroutine | seconds | % | Count | Mean |
| single-block read | 60,499 | 76.8% | 10,013,394 | 0.006 042 |
| other | 18,290 | 23.2% | 919,906 | 0.019 882 |
| Total | 78,789 | 100.0% | 10,933,300 | 0.007 206 |
From this, you should be able to make some simple predictions:
The snag is a data property called skew. Skew is nonuniformity in your data. A tidy little profile like the one I’ve shown here hides something important in that mean column: those ten million calls didn’t all have the same duration. Some took a lot less than 0.006 seconds, and some took a lot more. How much time you save when you eliminate half your calls depends on which calls you eliminate.
Here is a profile showing “single-block read” calls grouped by duration. It’s a histogram with 11 buckets:
| Range (seconds) | Duration | ||||
| {min ≤ duration < max} | Seconds | % | Calls | ||
| 1. | 0.000 000 | 0.000 001 ... | |||
Read now
Unlock full access