Skip to content

Commit

Permalink
Set WithDecoderConcurrency to 0 so GOMAXPROCS is used
Browse files Browse the repository at this point in the history
  • Loading branch information
bgreenlee committed Dec 15, 2022
1 parent 0e25670 commit 8575d6f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zstd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sarama

import (
"runtime"
"sync"

"github.com/klauspost/compress/zstd"
Expand Down Expand Up @@ -58,7 +57,7 @@ func getDecoder(params ZstdDecoderParams) *zstd.Decoder {
}
// It's possible to race and create multiple new readers.
// Only one will survive GC after use.
zstdDec, _ := zstd.NewReader(nil, zstd.WithDecoderConcurrency(runtime.NumCPU()))
zstdDec, _ := zstd.NewReader(nil, zstd.WithDecoderConcurrency(0))
zstdDecMap.Store(params, zstdDec)
return zstdDec
}
Expand Down

0 comments on commit 8575d6f

Please sign in to comment.