Adding overloads that can slice with fewer allocations.#55
Open
BrianMacIntosh wants to merge 1 commit intoDavidArayan:masterfrom
Open
Adding overloads that can slice with fewer allocations.#55BrianMacIntosh wants to merge 1 commit intoDavidArayan:masterfrom
BrianMacIntosh wants to merge 1 commit intoDavidArayan:masterfrom
Conversation
If the caller constructs a SlicerSourceMesh and passes it to the Slice overload that accepts it, the algorithm can avoid a lot of allocations from fetching mesh data. The caller can also opt to not produce either the upper or lower hull if they don't need it. With my 60-triangle test mesh, this takes allocations from 80-100 KB to 17-22 KB, and execution time from the high 2 ms to the low-mid 2 ms. The public API is fully backwards-compatible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains some changes to enable callers to significantly reduce allocations if they are slicing the same mesh multiple times:
With my 60-triangle test mesh, this takes allocations from 80-100 KB to 17-22 KB, and execution time from the high 2 ms to the low-mid 2 ms.
The public API is fully backwards-compatible.