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

Combine insert calls into bundles to reduce archetype count #151

Merged
merged 2 commits into from
Sep 10, 2023

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Sep 10, 2023

Removes individual insert calls in prepare.rs in favor of single calls that add multiple components at once. This reduces the archetype count significantly.

For a MinimalPlugins setup with just cuboid rigid bodies, the archetype count went from 26 to 5. It could probably still be reduced by a few archetypes, but it would maybe hurt code quality/modularity a bit.

For the "cubes" example, archetype count went from 65 to 29.
@Jondolf Jondolf added the C-Enhancement New feature or request label Sep 10, 2023
@Jondolf Jondolf merged commit 59e284a into main Sep 10, 2023
3 checks passed
@Jondolf Jondolf deleted the less-archetypes branch September 10, 2023 14:06
RJ pushed a commit to RJ/avian that referenced this pull request Sep 25, 2023
…f#151)

Removes individual `insert` calls in `prepare.rs` in favor of single calls that add multiple components at once. This reduces the archetype count significantly.

For a `MinimalPlugins` setup with just meshless cuboid rigid bodies, the archetype count went from 26 to 5. It could probably still be reduced by a few archetypes, but it would maybe hurt code quality/modularity a bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant