Skip to content

Commit

Permalink
Make chan buffered for better performance
Browse files Browse the repository at this point in the history
Now all threads can hit 100%
  • Loading branch information
vasi committed Oct 1, 2024
1 parent 0e32fcc commit 2585dff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (s *writerImpl) writeManyProducer(ctx context.Context, frameSource FrameSou
// Put a channel on the queue as a sort of promise.
// This is a nice trick to keep our results ordered, even when compression
// completes out-of-order.
ch := make(chan encodeResult)
ch := make(chan encodeResult, 1)
select {
case <-ctx.Done():
return nil
Expand Down

0 comments on commit 2585dff

Please sign in to comment.