Skip to content
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

Avoid having one system per component #296

Open
cBournhonesque opened this issue Apr 30, 2024 · 0 comments
Open

Avoid having one system per component #296

cBournhonesque opened this issue Apr 30, 2024 · 0 comments
Labels
A-Interpolation Related to snapshot interpolation A-Prediction C-Performance

Comments

@cBournhonesque
Copy link
Owner

cBournhonesque commented Apr 30, 2024

Lightyear has a bunch of component-specific systems that are the same for every component: interpolation, prediction, replication, events systems, etc.

Pros

  • code is simpler?
  • access to type information

Cons

  • many different systems: performance issues
  • potentially cannot run in parallel

This PR in bevy: bevyengine/bevy#12936 shows that this can have a significant costs.
There was system per event type, and the PR updates it to only one system that runs on all events.

Maybe we can do something simialr?

Maybe we could use bevyengine/bevy#13123 to build a system that queries all the relevant types into a single system while still retaining some parallelism

  • Create a system that queries any of A,B,C (using dynamic query builder)
  • Use the dynamic query to get a Ptr/component_id, and we can then use the component_registry
@cBournhonesque cBournhonesque changed the title Maybe simplify component-specific systems with https://github.com/bevyengine/bevy/pull/13123 Maybe parallelize component-specific systems with https://github.com/bevyengine/bevy/pull/13123 Apr 30, 2024
@cBournhonesque cBournhonesque changed the title Maybe parallelize component-specific systems with https://github.com/bevyengine/bevy/pull/13123 Avoid having one system per component May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Interpolation Related to snapshot interpolation A-Prediction C-Performance
Projects
None yet
Development

No branches or pull requests

1 participant