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

Remove some unnecessary allocations in affine constraint condensation #537

Merged
merged 2 commits into from
Nov 27, 2022

Conversation

fredrikekre
Copy link
Member

This patch removes some unnecessary allocations of a sparse matrix column which was needed before when the sparse matrix changed in-place. Since #436 we create a new matrix for the new entries and then add them in the end instead.

Comparison for the Stoke example in the docs:

  • Master:
    julia> @time create_sparsity_pattern(dh, ch);
      0.009940 seconds (2.91 k allocations: 13.387 MiB)
  • PR:
    julia> @time create_sparsity_pattern(dh, ch);
      0.004960 seconds (66 allocations: 12.581 MiB)

This patch removes some unnecessary allocations of a sparse matrix
column which was needed before when the sparse matrix changed in-place.
Since #436 we create a new matrix for the new entries and then add them
in the end instead.
src/Dofs/ConstraintHandler.jl Outdated Show resolved Hide resolved
src/Dofs/ConstraintHandler.jl Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2022

Codecov Report

Base: 92.56% // Head: 92.56% // No change to project coverage 👍

Coverage data is based on head (2ada10e) compared to base (c90c188).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #537   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files          22       22           
  Lines        3901     3901           
=======================================
  Hits         3611     3611           
  Misses        290      290           
Impacted Files Coverage Δ
src/Dofs/ConstraintHandler.jl 95.55% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fredrikekre fredrikekre merged commit 404219f into master Nov 27, 2022
@fredrikekre fredrikekre deleted the fe/microoptimizing branch November 27, 2022 18:14
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.

4 participants