PHP 8.1 introduced Fibers, a low-level primitive for cooperative multitasking. It sounded academic — until Drupal 11.3 used it to deliver the biggest performance improvement in a decade
This session unpacks what Fibers actually are — and, just as importantly, what they are not (no, it isn't multithreading). We'll then walk through how Drupal core repurposed them: not to wait on I/O, but to batch work — collecting entity loads and path-alias lookups across the render tree and running them in bulk instead of one query at a time. On complex pages that has meant query counts dropping by more than half.
Then the twist: the Drupal AI module's providers use the same Fiber primitive for the opposite goal — genuine I/O concurrency, overlapping the network wait on slow LLM calls so four requests can finish in the time of one. Same tool, inverse purpose.
What you'll learn:
- A correct mental model of Fibers: cooperative suspend/resume, single-threaded, not parallelism
- What actually changed in Drupal 11.3, and which gains are fiber-driven vs. adjacent
- How to structure custom modules, blocks and formatters (lazy builders, placeholders,
loadMultiple) so they benefit - How AI providers piggyback on the fiber loop — and the BigPipe gotcha that can silently break AI calls
Intended for module and theme developers, architects, and performance-minded engineers. Comfort with render arrays and entity loading assumed; no prior async-PHP knowledge needed