Replies: 1 comment
-
This syntax was "for each systems". It was unanimously removed in Bevy 0.3 due to being confusing for beginners, high cost to maintain, and very difficult to refactor as your needs for each system changed. As to automatically parallelizing within system work, I'm less opposed, but still very nervous about doing so implicitly. Writing your own parallelization in systems isn't hard. Critically, the choice to do so doesn't only depend on entity counts: the duration of the workload and other demand for threads matters more. Measuring this each frame in real time adds significant complexity and overhead. The BatchedQuery idea is appealing though, I'd be interested to see if that results in performance improvements! Overall, I would prefer to shift towards profile guided optimization with suggestions for explicit places to add parallelism. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion: For the very common use case of systems that just iterate over all entities from a given query, can we change the API so that the system gets called once for each entity instead of once for the whole query?
Advantages:
Alternative
An alternative that gets some (but not all) of the advantages would be to introduce a
BatchedQuery
type and relaxing the guarantees of how Bevy invokes systems with such aBatchedQuery
. A system with a normalQuery
still gets called exactly once and the query returns all entities, but a system with aBatchedQuery
may be called once or multiple times, each time containing a different batch of entities.This would not give the API simplification, but it would still allow Bevy to be smart about parallelism.
Beta Was this translation helpful? Give feedback.
All reactions