Optimizing Bevy System Parallelism with Component Access Analysis
Bevy's scheduler derives parallelism from component read/write patterns. Design systems for concurrent execution, verify with debugdump, and avoid serialization pitfalls.
11 Sept 2026, 13:36 UTC

When Systems Run Serial Instead of Parallel
\nYou added two Bevy systems that each write a different component, expecting them to run in parallel. Yet your frame time doesn't improve. The reason is buried in how Bevy's scheduler builds a directed acyclic graph from component access patterns.
\nBevy derives parallelism by inspecting each system's Component access -- whether it reads or writes a component, and whether that component is Send + Sync. Systems with disjoint write sets and no read/write conflicts can run concurrently without manual threading code. If a system reads a component that another writes, or writes a component a third reads, the scheduler inserts a sequential edge, forcing serialization.
Concrete example: designing for concurrency
\nfn resource_system(world: &mut World) {
// writes Health, no reads
world.spawn((Health(100),));
}
fn movement_system(world: &mut World) {
// reads Position, writes Velocity
for (pos, vel) in world.query::<(&Position, &mut Velocity)>().iter() {
pos.x += vel.x * world.delta_secs();
}
}
fn camera_system(world: &mut World) {
// reads Position, no writes
let positions = world.query::<&Position>().iter().collect::>();
// ... camera logic
}\nIn this setup, resource_system and movement_system have disjoint write sets (Health vs Velocity) and no read/write conflicts, so the scheduler places them in parallel stages. camera_system only reads Position, so it can run concurrently with any system that doesn't write Position.
Visualizing the schedule with bevy_mod_debugdump
\nAdd the bevy_mod_debugdump plugin and configure the schedule to emit a GraphViz DOT file. Open the file and look for edges labeled parallel or sequential. Systems connected by a parallel edge can run on separate threads; a sequential edge means the scheduler enforced ordering, often because of a shared component read/write.
// In your plugin build function:\nSchedule::builder()\n .add_system(resource_system)\n .add_system(movement_system)\n .add_system(camera_system)\n .build()\n .expect("schedule build");\nThen enable the debug dump feature in Cargo.toml:\n
bevy_mod_debugdump = { version = "0.4", features = ["dot"] }\nRun your app and find the generated schedule.dot. Systems that share no component access will appear as parallel branches; a system that writes Health and another that reads it will show a sequential edge.
Trade–off: archetype fragmentation and exclusive systems
\nBevy stores components in archetypes -- contiguous component tables. If you spread many optional components across entities, the scheduler creates many small archetypes, increasing overhead and reducing cache locality. Prefer composing related components together and minimizing Option usage in hot paths.
\nSystems that require &mut World or non-Send resources force a synchronization barrier, effectively serializing the critical path. Mark systems Send + Sync and avoid raw World mutation when possible to keep parallelism.
\nPlugin authors must declare SystemSet membership in build() or finish(); late registration after Schedule::build() is ignored, and hot-reloading plugins that add systems triggers a full schedule rebuild, pausing the world.
\nHow to verify your schedule today
\n- \n
- Create a minimal Bevy 0.14+ project. \n
- Add two systems that write different components. \n
- A third system that reads one and writes the other. \n
- Enable
bevy_mod_debugdumpand inspect the generatedDOTfile. \n - Confirm that the writer has a sequential edge to the reader/writer, and that the two writers run in parallel. \n
Benchmark frame time with cargo bench while varying archetype count (e.g., 10 vs 10,000 entities with different component combinations) to observe scaling behavior. If you introduce an exclusive system (&mut World), measure the serialization impact using FrameTimeDiagnosticsPlugin.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.