You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compress/flate: add Reset method to let callers avoid garbage #6138
Related to issue #6136, flate.NewWriter generates a lot of garbage which can't be
controlled by the calling application.
Options:
-- internal memory reuse in the flate package
-- Reset method (like bufio.Reader and bufio.Writer)
-- let buffers be passed in
Reset method please.
(Rationale: Having the reset method means that the buffer is attached to the Writer, not
magically moving around, so it gives the caller more control and also keeps the reuse
local to a specific package.)
TestOver65kFiles spends all its time garbage collecting.
Removing the 1.4 MB of allocations per each of the 65k
files brings this from 34 seconds to 0.23 seconds.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12894043
Per comment #2, this bug focused to be about adding a Reset method on flate.Writer so
callers can avoid 1.4 MB of garbage per writer if it affects them.
Should we create separate issues for compress/zlib and compress/gzip ? Most people never
use compress/flate directly, and the most common demand is probably Resetting a
gzip.Writer.
Activity
bradfitz commentedon Aug 13, 2013
Comment 1:
rsc commentedon Aug 13, 2013
Comment 2:
rsc commentedon Aug 13, 2013
Comment 3:
bradfitz commentedon Aug 13, 2013
Comment 4:
This issue was updated by revision c7d352c.
robpike commentedon Aug 16, 2013
Comment 5:
Status changed to Fixed.
bradfitz commentedon Aug 16, 2013
Comment 6:
Owner changed to @bradfitz.
Status changed to Accepted.
remyoudompheng commentedon Aug 24, 2013
Comment 7:
remyoudompheng commentedon Aug 29, 2013
Comment 8:
This issue was closed by revision f5f0e40.
Status changed to Fixed.
bradfitz commentedon Aug 30, 2013
Comment 9:
This issue was updated by revision db12f9d.