From c42ee4f3ee849315003d84052adc50cfbe843988 Mon Sep 17 00:00:00 2001 From: Ahrav Dutta Date: Tue, 30 Jan 2024 18:28:21 -0800 Subject: [PATCH] update comment --- pkg/engine/engine.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 19e330e1b639..75d94ec0f7ba 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -335,16 +335,14 @@ func (e *Engine) initialize(ctx context.Context, options ...Option) error { return fmt.Errorf("failed to initialize LRU cache: %w", err) } const ( - // detectableChunksChanMultiplier is set to 100 to accommodate a high number of concurrent worker goroutines. - // This multiplier ensures that the detectableChunksChan channel has sufficient buffer capacity to hold messages - // from multiple workers without blocking. A large buffer helps in maintaining smooth flow in the pipeline, - // especially when workers are producing data at a faster rate than it can be consumed. The specific value is - // chosen based on expected concurrency levels and the rate of message production. + // detectableChunksChanMultiplier is set to accommodate a high number of concurrent worker goroutines. + // This multiplier ensures that the detectableChunksChan channel has sufficient buffer capacity + // to hold messages from multiple workers without blocking. A large buffer helps accommodate for + // the fact workers are producing data at a faster rate than it can be consumed. detectableChunksChanMultiplier = 100 - // reverifiableChunksChanMultiplier is set to 25, providing a smaller buffer compared to detectableChunksChanMultiplier. - // This reflects the anticipated lower volume of data that needs re-verification. The buffer size is a trade-off - // between memory usage and the need to prevent blocking in worker goroutines. It is set based on the expected - // workload for re-verification processes, which is typically less intensive than the initial detection workload. + // reverifiableChunksChanMultiplier uses a smaller buffer compared to detectableChunksChanMultiplier. + // This reflects the anticipated lower volume of data that needs re-verification. + // The buffer size is a trade-off between memory usage and the need to prevent blocking. reverifiableChunksChanMultiplier = 25 )