Encoder reset (for c2go translated code) #308

Open
opened 2026-01-29 20:41:44 +00:00 by claunia · 0 comments
Owner

Originally created by @CAFxX on GitHub (Feb 4, 2020).

In #679 it was noted that native Brotli is currently missing a way to reset an encoder. We are currently using a c2go translation of native brotli (to avoid cgo, native dependencies and all the pain that entails), and that means that all memory used by brotli is allocated on the Go heap, and is therefore subject to GC.

Unfortunately, because native brotli is missing the encoder reset, the GC overhead becomes significant as there is no effective way to reuse instantiated encoders.

Our use-case (a custom HTTP reverse-proxy) does not change encoding parameters between uses, so it would not be required to efficiently handle the case in which encoding parameters change.

Originally created by @CAFxX on GitHub (Feb 4, 2020). In #679 it was noted that native Brotli is currently missing a way to reset an encoder. We are currently using a c2go translation of native brotli (to avoid cgo, native dependencies and all the pain that entails), and that means that all memory used by brotli is allocated on the Go heap, and is therefore subject to GC. Unfortunately, because native brotli is missing the encoder reset, the GC overhead becomes significant as there is no effective way to reuse instantiated encoders. Our use-case (a custom HTTP reverse-proxy) does not change encoding parameters between uses, so it would not be required to efficiently handle the case in which encoding parameters change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#308