-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parallel iteration benchmarks #2173
Comments
bench from https://github.com/ElliotB256/bevy_bench/blob/master/examples/bevy.rs looks not that far from https://github.com/cart/ecs_bench_suite/blob/bevy-benches/src/bevy/heavy_compute.rs, are there specific things to add? results also seems to be in the same ballpark as those reported
from
|
Adding that benchmark suite to Bevy itself will help reduce the need for this issue for sure. The other concern that I have is that perfectly predictable and uniform workloads like those shown in both of those examples are not always representative and will underestimate the potential gains of more sophisticated strategies. Parallel pathfinding might be a good example of an unpredictable but highly parallelizable task to supplement the example you linked. |
Is it worth noting that my bench is using a simpler operation - e.g. multiplying a couple of floats, instead of inverting a matrix 100 times? Each parallel task is much smaller. |
Yep: ideally we could vary the weight of the tasks to try and assess the relative overhead in each engine. |
I'd be happy to make a PR for adding some benchmarks for this issue |
Apologies I was away from this for so long. I've added an example of a
The numbers on my PC are as follows:
|
The batch size used for bevy in the above tests was 64. Changing to a batch size of 1024 offers an improvement to For different batch sizes:
It's not clear to me what the equivalent batch size is for the other tests. legion and specs (maybe the others too?) use rayon for parallel iteration, but I'm unfamiliar with the internals. Some information claims by default it splits every time (see e.g. this PR and this SO - but that doesn't seem quite right, and the Rayon page says:
|
@mockersf pointed out on discord that my example was creating a new task pool every iteration. Changing it so the task pool is initialised before hand, the results are:
This is much better. It is still not quite as good as the others, but at optimum batch sizes bevy is at least competitive. |
By chance I just saw on the discord:
Does anyone know if this is relevant for the benchmark? |
Checked and it isn't, All cores used in profiler.
|
With the inclusion of cart's ecs_bench_suite in #4225, do we need to cover this more? |
ElliotB256/bevy_bench#2 reveals that while Bevy can be quite competitive with the performance of other Rust ECS backends it's parallel iteration performance is quite poor.
This is likely to be particularly true with unpredictable workloads.
Once we have a good benchmark suite for this we can work on improving the performance in other issues.
The text was updated successfully, but these errors were encountered: