• Brad Fitzpatrick's avatar
    archive/zip: re-use flate.Writers when writing compressed files · 517f4a96
    Brad Fitzpatrick authored
    Prevents a ton of garbage. (Noticed this when writing large
    Camlistore zip archives to Amazon Glacier)
    
    Note that the Closer part of the io.WriteCloser is never given
    to users. It's an internal detail of the package.
    
    benchmark                         old ns/op     new ns/op     delta
    BenchmarkCompressedZipGarbage     42884123      40732373      -5.02%
    
    benchmark                         old allocs     new allocs     delta
    BenchmarkCompressedZipGarbage     204            149            -26.96%
    
    benchmark                         old bytes     new bytes     delta
    BenchmarkCompressedZipGarbage     4397576       66744         -98.48%
    
    LGTM=adg, rsc
    R=adg, rsc
    CC=golang-codereviews
    https://golang.org/cl/54300053
    517f4a96
Name
Last commit
Last update
..
testdata Loading commit data...
example_test.go Loading commit data...
reader.go Loading commit data...
reader_test.go Loading commit data...
register.go Loading commit data...
struct.go Loading commit data...
writer.go Loading commit data...
writer_test.go Loading commit data...
zip_test.go Loading commit data...