Skip to content

Commit 9501170

Browse files
committed
Update FIXME
1 parent eb86d34 commit 9501170

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/events/loop.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ func (el *EventLoop) Start(ctx context.Context) error {
8686
// Handle the current batch if no batch is being handled.
8787
if !handling {
8888
go handle(ctx, batch)
89-
// FIXME(pleshakov): Making an entirely new, zero-length slice seems unnecessary and potentially inefficient.
90-
// See https://github.com/nginxinc/nginx-kubernetes-gateway/pull/175#discussion_r946167207
89+
// FIXME(pleshakov): Making an entirely new buffer is inefficient and multiplies memory operations.
90+
// Use a double-buffer approach - create two buffers and exchange them between the producer and consumer
91+
// routines. NOTE: pass-by-reference, and reset buffer to length 0, but retain capacity.
9192
batch = make([]interface{}, 0)
9293
handling = true
9394
}

0 commit comments

Comments
 (0)