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

[ModelPart] improving speed of creating entities #314

Merged
merged 26 commits into from
Jan 17, 2022
Merged

Conversation

philbucher
Copy link
Member

@philbucher philbucher commented Jan 4, 2022

this PR improves the speed of creating entities tremendously
on my machine creating 10 million nodes now takes ~10s
previously creating 64.000 nodes took ~20s 😅

This improvement is achieved by using a custom container for the entities instead of std::vector
The key difference is that (as discussed) I created a new container that stores an . This way any find operation is much much faster. (the entities are still stored in a vector as before, but I can now access them by Id much faster which is used extensively in the creation of entities)

Additionally an interface for creating many entities at once is proposed. This one is TBD. For now the only improvement over the individual creation is the upfront reservation of memory, which makes it ~10-15% faster. This is less than I was hoping for/expected. I played around with creating entities in parallel, but then the Id-checks are more expensive which in turn pretty much nullifies the advantages of the parallelism

Copy link
Member

@pooyan-dadvand pooyan-dadvand left a comment

Choose a reason for hiding this comment

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

Thank you!

@philbucher philbucher merged commit b96224f into master Jan 17, 2022
@philbucher philbucher deleted the model-part-speedup branch January 17, 2022 14:11
@philbucher philbucher mentioned this pull request Jan 27, 2022
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants