bevy/benches
dataphract 0917c49b9b bench: add bevy_reflect::{List, Map, Struct} benchmarks (#3690)
# 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.
2022-05-17 04:16:53 +00:00
..
benches bench: add bevy_reflect::{List, Map, Struct} benchmarks (#3690) 2022-05-17 04:16:53 +00:00
Cargo.toml bench: add bevy_reflect::{List, Map, Struct} benchmarks (#3690) 2022-05-17 04:16:53 +00:00