-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
457: Reduced the complexity of the entity allocator r=torkleyy a=Flecheck This pull request uses a vector to store deleted entities to reduce the complexity of entity allocation to O(1)*. The maximum memory footprint is 2x the maximum current amount but it can only happen in the worst case and is I believe acceptable for such a use case. The current approach has the pitfall of often reusing the same entities, hence potentially making their generation quite high. Introducing a VecDequeue instead of the current Vec for the EntityCache could potentially solve this problem (with a cost in memory), so if you believe the change would be worth it I can add it relatively easily. However, this might be unnecessary as 2³¹-1 is the maximum generation. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/slide-rs/specs/457) <!-- Reviewable:end --> Co-authored-by: Flecheck <[email protected]>
- Loading branch information
Showing
3 changed files
with
163 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters