Skip to content

Commit

Permalink
Remove unnecessary options
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronoff97 committed Jun 8, 2023
1 parent 2543958 commit 1ca9138
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions zstd/zstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ var encoderOptions = []zstd.EOption{
// The default zstd window size is 8MB, which is much larger than the
// typical RPC message and wastes a bunch of memory.
zstd.WithWindowSize(512 * 1024),
// By default zstd uses GOMAXPROCS (64 in prod) threads to encode a
// given input, which is overkill for a typical RPC message and
// further wastes memory.
zstd.WithEncoderConcurrency(1),
}

var decoderOptions = []zstd.DOption{
// Similar, zstd uses GOMAXPROCS threads for decoding, which is
// overkill.
zstd.WithDecoderConcurrency(1),
}

type compressor struct {
Expand All @@ -50,7 +40,7 @@ type compressor struct {

func init() {
enc, _ := zstd.NewWriter(nil, encoderOptions...)
dec, _ := zstd.NewReader(nil, decoderOptions...)
dec, _ := zstd.NewReader(nil)
c := &compressor{
encoder: enc,
decoder: dec,
Expand Down

0 comments on commit 1ca9138

Please sign in to comment.