mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 13:13:49 +00:00
0917c49b9b
# Objective Partially addresses #3594. ## Solution This adds basic benchmarks for `List`, `Map`, and `Struct` implementors, both concrete (`Vec`, `HashMap`, and defined struct types) and dynamic (`DynamicList`, `DynamicMap` and `DynamicStruct`). A few insights from the benchmarks (all measurements are local on my machine): - Applying a list with many elements to a list with no elements is slower than applying to a list of the same length: - 3-4x slower when applying to a `Vec` - 5-6x slower when applying to a `DynamicList` I suspect this could be improved by `reserve()`ing the correct length up front, but haven't tested. - Applying a `DynamicMap` to another `Map` is linear in the number of elements, but applying a `HashMap` seems to be at least quadratic. No intuition on this one. - Applying like structs (concrete -> concrete, `DynamicStruct` -> `DynamicStruct`) seems to be faster than applying unlike structs. |
||
---|---|---|
.. | ||
benches | ||
Cargo.toml |