Skip to content

Commit

Permalink
Update content/news/2023-10-21-bevy-0.12/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: Alice Cecile <[email protected]>
  • Loading branch information
Trashtalk217 and alice-i-cecile authored Oct 18, 2023
1 parent 230cd6a commit a7e212c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion content/news/2023-10-21-bevy-0.12/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ Currently, exclusive systems and systems designed for system piping (with either
Additionally, one-shot systems are always evaluated sequentially, rather than in parallel.
While this reduces both complexity and overhead, this can be meaningfully slower than using a schedule with a parallel executor if you want to run a large number of heavy systems at once.

Registering and running systems is useful and allows for a great degree of control. However, if you _just_ want to run a system - sans registration - there's `RunSystemOnce`, a new trait that does just that.
Registering and running systems offers improved performance and correctness: you can have multiple copies of a single system, each with their own `Local` values and cached system state.
It also plays nice with asset-driven workflows: recording a mapping from a string to an identifier in a serialized callback is much nicer than trying to do so with Rust functions!

However, when you're just prototyping or writing a unit test, it can be a real hassle: who wants all that boilerplate and indirection!
When those caveats don't bother you, just use the `World::run_system_once` method.

```rust
use bevy::ecs::system::RunSystemOnce;
Expand Down

0 comments on commit a7e212c

Please sign in to comment.