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

Use single hash tables for compoment insertion/removal edges to improve spatial locality. #225

Merged
merged 3 commits into from
Dec 26, 2021
Merged

Conversation

adamreichold
Copy link
Collaborator

No description provided.

Copy link
Owner

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very tidy, thanks! Out of curiosity, any changes to the benchmarks? We're probably not exercising cases where this would matter (very high cache pressure, perhaps), but maybe it registers anyway.

src/world.rs Outdated Show resolved Hide resolved
@adamreichold
Copy link
Collaborator Author

Out of curiosity, any changes to the benchmarks? We're probably not exercising cases where this would matter (very high cache pressure, perhaps), but maybe it registers anyway.

I added a benchmark stressing insertion and removal but sticking around a steady state of attached components. This yields

test insert_remove                  ... bench:         356 ns/iter (+/- 225)

before and

test insert_remove                  ... bench:         330 ns/iter (+/- 123)

after these changes. I'd say close to noise with a positive tendency?

@Ralith
Copy link
Owner

Ralith commented Dec 26, 2021

Thanks for investigating!

@Ralith Ralith merged commit e259e78 into Ralith:master Dec 26, 2021
@adamreichold adamreichold deleted the global-edges branch December 26, 2021 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants