Count I/Os, Not Steps
Because of the slowness of I/Os, when it comes to algorithms that involve I/Os, computer scientists like to measure time complexity differently than they do with “regular” non-I/O algorithms. Specifically, instead of counting how many steps the algorithm takes, we count the number of I/Os the algorithm performs.
This line of thinking is driven by how much slower I/Os are when compared with main-memory steps. If an algorithm has 5 I/Os plus 300 main-memory steps, the 5 I/Os are so much slower than the 300 main-memory steps. Therefore, we simply ignore the main-memory steps altogether.
This is a bit similar to what I discussed back in Volume 1, Chapter 6, namely, that when we have an algorithm with N4+N3+N2+N steps, we only ...
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