Skip to content

Conversation

@mrxz
Copy link
Collaborator

@mrxz mrxz commented Aug 18, 2025

Similar to what is done for floatBitsToUint/uintBitsToFloat the toHalf/fromHalf can be implemented using a Float16Array and Uint16Array pair. Since support for Float16Array is relatively new (https://caniuse.com/mdn-javascript_builtins_float16array) this PR checks if it's present, otherwise falling back to the current JS implementation.

There's a performance uplift with this approach. Though since the toHalf/fromHalf is only used for encoding and decoding the center of splats, it's overall impact on parsing time is limited.

@dmarcos
Copy link
Contributor

dmarcos commented Sep 15, 2025

Thank you!

@dmarcos dmarcos merged commit f995e5c into sparkjsdev:main Sep 15, 2025
2 checks passed
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