Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How many parallels to use?

  • First of all, I call them "parallels" as this applies to forks, threads, spawns, and even to async code.

  • Overhead of creating new parallel.

  • Overhead of communication (sending job input to parallel, receiving results).

  • Total number of items to process.

  • Time it takes to process an item.

  • Distribution of processing times. (e.g. one long and many short jobs.)

  • Number of cores (CPUs).