Skip to content

Commit

Permalink
Switch to klauspost/compress/gzip package
Browse files Browse the repository at this point in the history
The "github.com/klauspost/compress/gzip" package is about 8x faster when
compressing using gzip.
  • Loading branch information
hansmi committed Nov 23, 2022
1 parent 4bcd813 commit 1c0f258
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/google/subcommands v1.2.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/klauspost/compress v1.15.12
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/common v0.37.0
go.uber.org/multierr v1.8.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
Expand Down
3 changes: 2 additions & 1 deletion internal/snapshotstream/stream.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package snapshotstream

import (
"compress/gzip"
"crypto/sha256"
"encoding/hex"
"errors"
Expand All @@ -12,8 +11,10 @@ import (
"path/filepath"
"strings"
"sync"
"time"

"github.com/hansmi/prombackup/api"
"github.com/klauspost/compress/gzip"
"go.uber.org/multierr"
)

Expand Down

0 comments on commit 1c0f258

Please sign in to comment.