From af1adea554b03462124b35f8f5817d3180227969 Mon Sep 17 00:00:00 2001 From: Jaz Date: Sun, 22 Sep 2024 22:08:40 -0700 Subject: [PATCH] Use smaller encoding window, reduce encoder concurrency since we only use it serially --- pkg/consumer/consumer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/consumer/consumer.go b/pkg/consumer/consumer.go index 78fd38c..37ad452 100644 --- a/pkg/consumer/consumer.go +++ b/pkg/consumer/consumer.go @@ -72,7 +72,8 @@ func NewConsumer( return nil, fmt.Errorf("failed to create clock: %w", err) } - encoder, err := zstd.NewWriter(nil, zstd.WithEncoderDict(models.ZSTDDictionary)) + // Create a zstd encoder using the dictionary and a window size of 8KB + encoder, err := zstd.NewWriter(nil, zstd.WithEncoderDict(models.ZSTDDictionary), zstd.WithWindowSize(2<<12), zstd.WithEncoderConcurrency(1)) if err != nil { return nil, fmt.Errorf("failed to create zstd encoder: %w", err) }