bevy/crates/bevy_ecs/examples
James Liu 8ace2ff9e3
Only run event systems if they have tangible work to do (#7728)
# Objective
Scheduling low cost systems has significant overhead due to task pool
contention and the extra machinery to schedule and run them. Event
update systems are the prime example of a low cost system, requiring a
guaranteed O(1) operation, and there are a *lot* of them.

## Solution
Add a run condition to every event system so they only run when there is
an event in either of it's two internal Vecs.

---

## Changelog
Changed: Event update systems will not run if there are no events to
process.

## Migration Guide
`Events<T>::update_system` has been split off from the the type and can
be found at `bevy_ecs::event::event_update_system`.

---------

Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
2023-09-24 00:16:33 +00:00
..
change_detection.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
events.rs Only run event systems if they have tangible work to do (#7728) 2023-09-24 00:16:33 +00:00
resources.rs docs: update docs and comments that still refer to stages (#8156) 2023-03-27 21:50:21 +00:00