Reusing/resetting a brotli.Writer instance
Open
- Dominant language
- TypeScript
- Stars
- 14.9k
- Forks
- 1.4k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
We saw good performance improvements in our go program when using a sync.Pool to cache and reset gzip writers rather than creating them anew each time.
I was wondering whether the same would be true for the brotli writer, too, but that one doesn't seem to have a trivial "reset this" method. On the underlying C level it looks like an encoder state can be "created"/"destroyed", but there are functions to "initialize" and "cleanup" as well.
Before I try to hack this together: Do you think that pooling/reusing of the encoder state could have a measurable/visible performance impact?
Contributor guide
Assessment
This issue has not been assessed yet.