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

v1.8.0 performance, improved booleans #13

Merged
merged 35 commits into from
Aug 16, 2024
Merged

v1.8.0 performance, improved booleans #13

merged 35 commits into from
Aug 16, 2024

Conversation

reececomo
Copy link
Owner

@reececomo reececomo commented Aug 13, 2024

Caution

Ignore the violent commit history.

TIL you need to jest --clearCache downstream 😆

What's changed?

  • Performance improvements to encoding (3x)
    • Dropped runtime type-checking - carried over from js-binary but now we'll let TypeScript be responsible for this and just be a thin wrapper over DataView.
    • Drop encode-time validation and transforms (e.g. Math.flooring ints), and defer to the underlying TypedArray behavior instead.
  • Dropped Bools8, Bools16 and Bools32 in favor of Bools. If needed, you can DIY with mask() and unmask() and the raw UInt types.
  • Updated Bools encoding.
  • renamed scalarRound to scalround to align with Math.fround() and f16round()
  • Renamed Scalar to Scalar8 to more closely align with the other fixed-length types like UInt8 and Float16.
  • Dropped EncodeError and DecodeError in favor of native TypeError or TinybufError where appropriate.

@reececomo reececomo closed this Aug 14, 2024
@reececomo reececomo reopened this Aug 16, 2024
@reececomo reececomo merged commit ea560ba into main Aug 16, 2024
2 checks passed
@reececomo reececomo deleted the v1.8.0-bools branch August 16, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant