Code organization · demo 20

Pipeline: back-pressure and the bottleneck

A file of transfers goes through six filters linked by bounded pipes. They all work at the same time; the slowest sets everyone's pace, and when a pipe is full, the stage before it waits.

Reduced motion: the scene is paused; use "Step" or "Play".

    What to watch

    • The pipe before CheckFraud is full; the stages before it turn amber: they wait to be able to write. That is back-pressure, climbing back to the reading of the file: the lines in memory stay bounded.
    • CheckFraud +1: a stateless filter can be duplicated, and the throughput rises… until Validate becomes the new bottleneck. The demo's real run: 24,000 lines/s with 1 copy, 131,000 with 8.
    • Slow down Execute: a stateful filter can't be duplicated. Copies of CheckFraud no longer help.