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

Use StaticArrays in Binary Subdivision #141

Merged
merged 3 commits into from
Feb 21, 2025
Merged

Conversation

GeorgeR227
Copy link
Contributor

The resulting binary_subdivision function was encountering some performance regressions from the use of batched updates by using iterators. I've kept the batching but instead use StaticArrays to avoid intermediate allocations. While the resulting code isn't quite as a fast as the original, non-batched code, it is fairly close.

For triangulated_grid, 150 x 150 length, with 1 grid spacing:
Original (non-batched)
31.626 ms (1239233 allocations: 129.83 MiB)

Original (batched with Iterators)
53.896 ms (2320433 allocations: 173.13 MiB)

Current (batched with SVector)
35.341 ms (1239233 allocations: 129.83 MiB)

@lukem12345
Copy link
Member

from the use of batched updates by using iterators.

In my original comment on the other PR, by "batched" I was referring to assigning face maps in the same way that point data is currently assigned.

@lukem12345 lukem12345 merged commit 4bc37f1 into main Feb 21, 2025
8 of 9 checks passed
@lukem12345 lukem12345 deleted the gr/static_binsubdiv branch February 21, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants