bevy/crates/bevy_app/src
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
..
app.rs Only run event systems if they have tangible work to do (#7728) 2023-09-24 00:16:33 +00:00
ci_testing.rs Take example screenshots in CI (#8488) 2023-05-01 18:00:01 +00:00
lib.rs Add SpawnScene to prelude (#9451) 2023-08-19 19:42:12 +00:00
main_schedule.rs Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
plugin_group.rs Add track_caller to App::add_plugins (#9174) 2023-07-23 01:02:20 +00:00
plugin.rs Add track_caller to App::add_plugins (#9174) 2023-07-23 01:02:20 +00:00
schedule_runner.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00