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

Replace sparse with spzeros! in grid coloring #1064

Merged
merged 1 commit into from
Sep 22, 2024
Merged

Conversation

fredrikekre
Copy link
Member

@fredrikekre fredrikekre commented Sep 21, 2024

This patch uses the more optimal spzeros! instead of sparse when creating the incidence matrix for the grid coloring. This doesn't improve the performance by much, but no reason not to use it.

For a grid with 1 million elements:
3.181 s (4537096 allocations: 1.99 GiB) # PR
3.534 s (4537126 allocations: 2.29 GiB) # master

This patch uses the more optimal `spzeros!` instead of `sparse` when
creating the incidence matrix for the grid coloring. This doesn't
improve the performance by much, but no reason not to use it.

For a grid with 1 million elements:
  3.181 s (4537096 allocations: 1.99 GiB) # PR
  3.534 s (4537126 allocations: 2.29 GiB) # master
@fredrikekre
Copy link
Member Author

fredrikekre commented Sep 21, 2024

Looks like latest NearestNeighbors broke tests here @KristofferC

Edit: see KristofferC/NearestNeighbors.jl#203

@fredrikekre fredrikekre merged commit 84d4600 into master Sep 22, 2024
4 of 9 checks passed
@fredrikekre fredrikekre deleted the fe/coloring branch September 22, 2024 17:48
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.

1 participant