Re-use gzip writers in a pool

Since they allocate sizeable chunks of memory, this can save on garbage-collection.
This commit is contained in:
Bryan Boreham
2018-07-08 16:30:04 +00:00
parent 777360dc9e
commit 70cd79307e
2 changed files with 14 additions and 13 deletions

View File

@@ -2,7 +2,6 @@
package main
import (
"compress/gzip"
"flag"
"log"
@@ -20,7 +19,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
if err = rpt.WriteToFile(flag.Arg(1), gzip.DefaultCompression); err != nil {
if err = rpt.WriteToFile(flag.Arg(1)); err != nil {
log.Fatal(err)
}
}