From 07e4bc0cd7208dfca041a5c95d315aa463e22ae3 Mon Sep 17 00:00:00 2001 From: DavePearce Date: Thu, 5 Sep 2024 18:10:59 +0100 Subject: [PATCH] Tweak channel buffers sizes This puts through some minor tweaks to channel buffer sizes. --- pkg/cmd/check.go | 2 +- pkg/schema/schemas.go | 2 +- pkg/trace/lt/reader.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/check.go b/pkg/cmd/check.go index 0b9c4a28..5967e81a 100644 --- a/pkg/cmd/check.go +++ b/pkg/cmd/check.go @@ -210,7 +210,7 @@ func validationCheck(tr trace.Trace, schema sc.Schema) error { schemaCols := schema.Columns() // Construct a communication channel for errors. - c := make(chan error, 10) + c := make(chan error, tr.Width()) // Check each column in turn for i := uint(0); i < tr.Width(); i++ { // Extract ith column diff --git a/pkg/schema/schemas.go b/pkg/schema/schemas.go index ea0aed74..fc5140ab 100644 --- a/pkg/schema/schemas.go +++ b/pkg/schema/schemas.go @@ -68,7 +68,7 @@ func processConstraintBatch(batch uint, batchsize uint, iter util.Iterator[Const var err error n := uint(0) - c := make(chan error, 10) + c := make(chan error, 128) stats := util.NewPerfStats() // Launch at most 100 go-routines. for ; n < batchsize && iter.HasNext(); n++ { diff --git a/pkg/trace/lt/reader.go b/pkg/trace/lt/reader.go index 3611f5c3..07aebde4 100644 --- a/pkg/trace/lt/reader.go +++ b/pkg/trace/lt/reader.go @@ -36,7 +36,7 @@ func FromBytes(data []byte) ([]trace.RawColumn, error) { } // Determine byte slices offset := uint(len(data) - buf.Len()) - c := make(chan util.Pair[uint, util.Array[fr.Element]], 100) + c := make(chan util.Pair[uint, util.Array[fr.Element]], ncols) // Dispatch go-routines for i := uint(0); i < uint(ncols); i++ { ith := headers[i]