bevy/crates/bevy_asset/src/io
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
..
embedded Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
file Normalise root path in file_watcher (#12102) 2024-02-25 15:21:06 +00:00
android.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
gated.rs Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
memory.rs Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
mod.rs Added Support for Extension-less Assets (#10153) 2024-01-31 14:58:08 +00:00
processor_gated.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
source.rs Improve file watcher error msg (#12060) 2024-02-23 17:39:33 +00:00
wasm.rs Added AssetLoadFailedEvent, UntypedAssetLoadFailedEvent (#11369) 2024-01-17 21:12:00 +00:00