Off the top of my head
- Use the byte utilities provided by creating a
ReadableStream with {type: "bytes"} that avoid copying data to stream internals
- Avoid copying data when doing
result.value = new Uint8Array([...leftoverBytes, ...result.value]);
- maybe check lz4 decompression performance & impact
This is to investigate, to see if any of those has any real impact