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

port upstream hecs performance improvements #716

Merged
merged 1 commit into from Oct 22, 2020

Conversation

cart
Copy link
Member

@cart cart commented Oct 22, 2020

Hecs just introduced some pretty significant performance improvements in:

Ralith/hecs#93 (@mjhostet)
Ralith/hecs#95 (@Ralith)
Ralith/hecs#96 (@Ralith)

image

@cart
Copy link
Member Author

cart commented Oct 22, 2020

My big hope is that this will finally allow us to merge QueryBorrow and QueryIter without killing performance, enabling:

// query.iter() returns an actual iterator
for x in query.iter() {}

I'm testing that now

@Ralith
Copy link

Ralith commented Oct 22, 2020

merge QueryBorrow and QueryIter

FWIW these are distinct for correctness, not performance, reasons. The references yielded by iteration must have lifetimes bound to something more short-lived than the world to prevent illegal aliasing, and they can't be bound to the iterator object directly because Iterator doesn't support that.

@cart
Copy link
Member Author

cart commented Oct 22, 2020

FWIW these are distinct for correctness, not performance, reasons. The references yielded by iteration must have lifetimes bound to something more short-lived than the world to prevent illegal aliasing, and they can't be bound to the iterator object directly because Iterator doesn't support that.

Thanks for the heads up! We've accounted for the correctness part by removing locks entirely on world apis / relying on lifetime protection for mutable queries. Bevy's higher-level system queries also prevent unsafe iteration.

However merging them (prior to this pr) severely tanked performance for some reason.

@Moxinilian Moxinilian added A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times labels Oct 22, 2020
@cart cart merged commit a6ac8fa into bevyengine:master Oct 22, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants