bevy/benches/benches/bevy_ecs
Pixelstorm faa1b57de5
Global TaskPool API improvements (#10008)
# Objective

Reduce code duplication and improve APIs of Bevy's [global
taskpools](https://github.com/bevyengine/bevy/blob/main/crates/bevy_tasks/src/usages.rs).

## Solution

- As all three of the global taskpools have identical implementations
and only differ in their identifiers, this PR moves the implementation
into a macro to reduce code duplication.
- The `init` method is renamed to `get_or_init` to more accurately
reflect what it really does.
- Add a new `try_get` method that just returns `None` when the pool is
uninitialized, to complement the other getter methods.
- Minor documentation improvements to accompany the above changes.

---

## Changelog

- Added a new `try_get` method to the global TaskPools
- The global TaskPools' `init` method has been renamed to `get_or_init`
for clarity
- Documentation improvements

## Migration Guide

- Uses of `ComputeTaskPool::init`, `AsyncComputeTaskPool::init` and
`IoTaskPool::init` should be changed to `::get_or_init`.
2023-10-23 20:48:48 +00:00
..
components Use single threaded executor for archetype benches (#9835) 2023-09-18 16:06:42 +00:00
events fix deprecation warning in bench (#9823) 2023-09-16 09:27:13 +00:00
iteration Global TaskPool API improvements (#10008) 2023-10-23 20:48:48 +00:00
scheduling Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
world Remove useless single tuples and trailing commas (#9720) 2023-09-08 21:46:54 +00:00
benches.rs Basic event benchmarks (#8251) 2023-03-31 07:12:18 +00:00
change_detection.rs Remove useless single tuples and trailing commas (#9720) 2023-09-08 21:46:54 +00:00
empty_archetypes.rs Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00