If we reduce code duplication in similar functions (sparse and table), we could merge these files together and it would help making the file organisation more readable. Their naming is also currently not coherent, which doesn't help with grouping them mentally.
Objective
In ECS benchmarks, code is always duplicated to account for
Table
andSparse
storage types.Duplication leads to difficulty in:
Work In Progress
Possible solutions
Generic function to help avoid the duplicated code.
See implementation
```rs fn generic_benchDeclarative macro
It was my first attempt but macros are harder to read for most people, less standard and this solution would need more work to be as flexible.
See implementation
```rs #[macro_export] macro_rules! bevy_bench { ( $( $bench:ident, $harness:ident),+ ) => { $( fn $harness(criterion: &mut Criterion) { let mut group: criterion::BenchmarkGroupprocedural macro
As those are more complex I think another solution is better until proven otherwise.
If we reduce code duplication in similar functions (
sparse
andtable
), we could merge these files together and it would help making the file organisation more readable. Their naming is also currently not coherent, which doesn't help with grouping them mentally.