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 unnecessary array copies for add_line_segments() #363

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

brentyi
Copy link
Collaborator

@brentyi brentyi commented Jan 4, 2025

drei's <Line /> abstraction expects normal JS arrays as input, which it then internally converts to typed arrays. We already had typed arrays, so unnecessary conversion was happening:

typed Float32Array => JS array => back to Float32Array

Eliminating this makes line segment mounting feel much snappier.

@brentyi brentyi merged commit 46a236a into main Jan 4, 2025
15 checks passed
@brentyi brentyi deleted the brent/faster_line_segments branch January 4, 2025 10:55
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.

1 participant