Where benefits will accrue

A program that does a great deal of calculation and relatively little I/O will not see much benefit from concurrent processing. If a calculation has a budget of 28 minutes of computation, then interleaving the operations in different ways won't have a dramatic impact. Using eight cores may cut the time by approximately one-eighth. The actual time savings depend on the OS and language overheads, which are difficult to predict. Introducing concurrency will not have the kind of performance impact that a better algorithm will have.

When a calculation involves a great deal of I/O, then interleaving CPU processing with I/O requests will dramatically improve performance. The idea is to do computations on some pieces of ...

Get Functional Python Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.