Skip to content

Avoid having one system per component #296

@cBournhonesque

Description

@cBournhonesque

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions