Skip to content

Conversation

@tiennou
Copy link

@tiennou tiennou commented Nov 7, 2025

Since we're about to replace the whole of _bits with a new value, calling the constructor leads to the code creating a full 2500 big UInt8Array just to replace it instantly.

Fix the issue by doing the same trick CostMatrix.deserialize does; use Object.create to skip the constructor cost.

Since we're about to replace the whole of `_bits` with a new value,
calling the constructor leads to the code creating a full 2500 big
`UInt8Array` just to replace it instantly.

Fix the issue by doing the same trick `CostMatrix.deserialize` does;
use `Object.create` to skip the constructor cost.
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