File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,9 @@ func (el *EventLoop) Start(ctx context.Context) error {
86
86
// Handle the current batch if no batch is being handled.
87
87
if ! handling {
88
88
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.
91
92
batch = make ([]interface {}, 0 )
92
93
handling = true
93
94
}
You can’t perform that action at this time.
0 commit comments