Streamed decoding only provides unneccessarily huge chunks #80

Closed
opened 2026-01-29 20:32:04 +00:00 by claunia · 2 comments
Owner

Originally created by @mbevin on GitHub (Dec 18, 2015).

When streaming encoding, it's working fine using small buffer-sizes (indeed only does so), thus presumably it should be able to decode in similarly small chunks, however the streaming decoder seems to only return 4.19mb chunks (i.e. i'm streaming data to BrotliDecompressBufferStreaming in 16kb chunks, but it only first returns anything whenever it has accumulated 4.19mb available).

Given that this seems unneccessary (since the data was streamed on write in far smaller chunks), it would be very preferable to be able to have it return more frequent + smaller chunk sizes, as this kind of delay+chunkiness makes it unusable for some streaming scenarios, and less ideal for others.

Originally created by @mbevin on GitHub (Dec 18, 2015). When streaming encoding, it's working fine using small buffer-sizes (indeed only does so), thus presumably it should be able to decode in similarly small chunks, however the streaming decoder seems to only return 4.19mb chunks (i.e. i'm streaming data to BrotliDecompressBufferStreaming in 16kb chunks, but it only first returns anything whenever it has accumulated 4.19mb available). Given that this seems unneccessary (since the data was streamed on write in far smaller chunks), it would be very preferable to be able to have it return more frequent + smaller chunk sizes, as this kind of delay+chunkiness makes it unusable for some streaming scenarios, and less ideal for others.
Author
Owner

@eustas commented on GitHub (Dec 18, 2015):

Decoder dumps all the output is has after it consumed the next chunk of input: https://github.com/google/brotli/blob/master/dec/decode.c#L1954

Please, could you provide sample data and code, so we could investigate what is going wrong?

@eustas commented on GitHub (Dec 18, 2015): Decoder dumps all the output is has after it consumed the next chunk of input: https://github.com/google/brotli/blob/master/dec/decode.c#L1954 Please, could you provide sample data and code, so we could investigate what is going wrong?
Author
Owner

@mbevin commented on GitHub (Dec 21, 2015):

Ok, looks like you fixed it since I originally discovered the issue (Oct 21), as pulling the latest from master now fixed the issue (average chunk size dropped from that very consistent 4.19mb to ~31kb. I originally reported it in the forum, but then getting no response there discovered this place after a month or so - next time I'll post here I guess :)

@mbevin commented on GitHub (Dec 21, 2015): Ok, looks like you fixed it since I originally discovered the issue (Oct 21), as pulling the latest from master now fixed the issue (average chunk size dropped from that very consistent 4.19mb to ~31kb. I originally reported it in the forum, but then getting no response there discovered this place after a month or so - next time I'll post here I guess :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#80