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

derive(Event) option to use single buffering #10759

Open
ItsDoot opened this issue Nov 27, 2023 · 2 comments
Open

derive(Event) option to use single buffering #10759

ItsDoot opened this issue Nov 27, 2023 · 2 comments
Labels
A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times

Comments

@ItsDoot
Copy link
Contributor

ItsDoot commented Nov 27, 2023

What problem does this solve or what need does it fill?

For some types of events, like an UpdatePosition event, data that is one frame/tick behind might be useless. Having the option to disable double buffering and use single buffering per event type could be a nice performance improvement.

What solution would you like?

#[derive(Event)]
#[event(buffer = "single")]
struct PositionEvent {
    x: i32,
    y: i32,
    z: i32,
}

What alternative(s) have you considered?

Continue to use double buffering.

@ItsDoot ItsDoot added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events labels Nov 27, 2023
@ItsDoot ItsDoot changed the title derive(Event) option to disable double buffering derive(Event) option to use single buffering Nov 27, 2023
@ItsDoot ItsDoot added C-Performance A change motivated by improving speed, memory usage or compile times and removed C-Feature A new feature, making something new possible labels Nov 27, 2023
@ItsDoot
Copy link
Contributor Author

ItsDoot commented Nov 27, 2023

Related issue: #2071
Related PRs: #7957 and #2073

Note: this issue, unlike #2071, is specifically about the buffering aspect, not the data type used to store them.

@alice-i-cecile
Copy link
Member

I would also really like to see buffer = "manual", ideally as part of the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

No branches or pull requests

2 participants