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

perf(slice): reduce memory allocation + replace stack #7

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

william-silversmith
Copy link
Contributor

The slowest part of the slice operation is the plane allocation, which is very large because it is was simple to not assume which direction will be drawn on.

(512 * sqrt(3) * 2 * anisotropy(10))^2 * 8 bytes = 2.5 GB

However, if we calculate the plane area we actually need, only a fraction of that allocation is needed.

With a smaller plane, there is no need to use a stack. We can just use regular loops.

The main issue here is whether I did the calculation right. So far so good...

@william-silversmith william-silversmith added the enhancement New feature or request label Feb 24, 2024
@william-silversmith william-silversmith self-assigned this Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant