The is code does not seem optimal.
Avoid using ‘data.buffer.slice()’ as it allocates memory and creates a copy.
Instead use ‘new DataView(data.buffer, byteOffset, byteLength)’ to reference the same buffer.
The code is at https://github.com/fiatjaf/nostr-json-benchmarks
(as you can see, the "leaner" codec is much faster than anything else when running on Go.)
The is code does not seem optimal.
Avoid using ‘data.buffer.slice()’ as it allocates memory and creates a copy.
Instead use ‘new DataView(data.buffer, byteOffset, byteLength)’ to reference the same buffer.
No replies yet.