Repository navigation
Split benchmarks with features to allow avoiding unnecessary compilation - #25321
Conversation
hymm
left a comment
There was a problem hiding this comment.
This makes sense to me. Just spent a bunch of time recompiling when I only cared about the ecs benches.
kfc35
left a comment
There was a problem hiding this comment.
the only thing that gives me pause is the removal of dev-dependencies and having the default feature include all of the bevy dependencies, but i assume that's fine
| ] } | ||
|
|
||
| # Other crates | ||
| glam = { version = "0.33.2", default-features = false, features = [ |
There was a problem hiding this comment.
should the rest of these still be considered [dev-dependencies]?
There was a problem hiding this comment.
I assume they're small enough (relative to the Bevy crates) that it doesn't really matter
There was a problem hiding this comment.
It doesn't really matter if they're in dev-dependencies or dependencies. This crate is only ever run through cargo bench which compiles with the dev-dependcies.
|
@mockersf Is there any consideration for bevy metrics that this pr would need to handle? With default features this runs all the benches. |
Forgot to add new benchmarks to the default features when fixing conflicts in bevyengine#25321, which I think would make it hard for CI to run them (unless it always does `--all-features`, but I dunno).
Objective
When messing with ECS internals, I tend to run benchmarks often to see what changes make a difference. Of course, even a small change in
bevy_ecsmeans recompiling it, as well as anything else that depends on it. Since benchmarks share the same dependencies, that includesbevy_render, even though I'm only trying to runbevy_ecsbenchmarks.bevy_renderalso happens to take way longer to compile than anything else. I'd like to be able to avoid compiling it.Solution
Add features to
benchesto enable specific crates' benchmarks: featurebench_ecsforbevy_ecs,bench_renderforbevy_render, etc.All features are enabled by default, so default behavior should be the same.
The dependencies are normal dependencies instead of dev-dependencies now, but they're also now
optional = true. I'm not really sure how/if stuff outsidebenchesinteracts with dependencies insidebenches, but it's hopefully fine.Testing
Ran all the benchmarks, both individually with each feature and all together with default features.