Global Feed Post Login
Replying to Avatar Heri Sim

The javascript code does not seem optimal.

Avoid using ‘data.buffer.slice()’ as it allocates memory and creates a copy.

Have you tried using ‘new DataView(data.buffer, byteOffset, byteLength)’ to reference the same buffer?

If you need more performance, you may also use ‘new Uint8Array(data.buffer, byteOffset, length)’ which is common practice.

Avatar
fiatjaf 2y ago

No, I did not try. I don't understand why can't we just have a simple byte array and instead have all these weird types. Please send a pull request.

Reply to this note

Please Login to reply.

Discussion

No replies yet.