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

MatrixFree DoFInfo: Break out from some expensive loops #14115

Merged
merged 1 commit into from Jul 20, 2022

Conversation

kronbichler
Copy link
Member

This function is not super expensive, but enough to be noticed, so we should not continue outer loops when we already breaked inside a nested loop.

Comment on lines +722 to +724
for (const unsigned int *indices = dof_indices;
indices != dof_indices + ndofs;
++indices)
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that I could also break out of this loop, but the break here is a very unlikely case, so I consider it more expensive to add a check than continuing. Of course, if we want code symmetry we might still consider having it here as well.

@bangerth bangerth merged commit 10aeb35 into dealii:master Jul 20, 2022
@kronbichler kronbichler deleted the avoid_some_expensive_loops branch September 5, 2022 12:09
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
…_loops

MatrixFree DoFInfo: Break out from some expensive loops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants