go-zlib icon indicating copy to clipboard operation
go-zlib copied to clipboard

ReadBuffer takes too long if compressed data > 90kb

Open zannet opened this issue 1 year ago • 0 comments

What should I do if I don't know the uncompressed size? ReadBuffer takes too long if compressed data > 90kb with nil out, should I make a big enough out like this:

out := make([]byte, 1000000) n, _, err := zr.ReadBuffer(message, out) fmt.Printf("message read: %d, decoded message: %s, err: %v\n", n, out, err)

But how large should I make out? Is there any other method to decompress the data in one go?

edit: ReadBuffer will block if nil out

zannet avatar Sep 05 '24 01:09 zannet