bevy/tools
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
..
build-templated-pages Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
build-wasm-example Add a [lints] entry for workspace members missing it (#11900) 2024-02-19 17:09:47 +00:00
ci Check cfg during CI and fix feature typos (#12103) 2024-02-25 15:19:27 +00:00
example-showcase Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
publish.sh Upstreaming bevy_color. (#12013) 2024-02-23 17:51:31 +00:00