bevy/crates/bevy_app/src
Tristan Guichaoua 1cded6ac60
Use immutable key for HashMap and HashSet (#12086)
# Objective

Memory usage optimisation

## Solution

`HashMap` and `HashSet`'s keys are immutable. So using mutable types
like `String`, `Vec<T>`, or `PathBuf` as a key is a waste of memory:
they have an extra `usize` for their capacity and may have spare
capacity.
This PR replaces these types by their immutable equivalents `Box<str>`,
`Box<[T]>`, and `Box<Path>`.

For more context, I recommend watching the [Use Arc Instead of
Vec](https://www.youtube.com/watch?v=A4cKi7PTJSs) video.

---------

Co-authored-by: James Liu <contact@jamessliu.com>
2024-02-26 16:27:40 +00:00
..
app.rs Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
ci_testing.rs Take example screenshots in CI (#8488) 2023-05-01 18:00:01 +00:00
lib.rs Inverse missing_docs logic (#11676) 2024-02-03 21:40:55 +00:00
main_schedule.rs System Stepping implemented as Resource (#8453) 2024-02-03 05:18:38 +00:00
plugin_group.rs Added add_group to PluginGroupBuilder (#9530) 2024-02-25 21:23:28 +00:00
plugin.rs Expressively define plugins using functions (#11080) 2024-01-27 02:40:15 +00:00
schedule_runner.rs Revert App::run() behavior/Remove winit specific code from bevy_app (#10389) 2023-11-16 21:50:17 +00:00