Skip to content

Commit eb302a5

Browse files
committed
improve performance with large batch capacity
1 parent a4a783f commit eb302a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dataloadgen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ func (l *Loader[KeyT, ValueT]) startBatch(ctx context.Context) {
238238
firstContext: ctx,
239239
}
240240
if l.maxBatch != 0 {
241-
batch.contexts = make([]context.Context, 0, l.maxBatch)
242-
batch.keys = make([]KeyT, 0, l.maxBatch)
241+
batch.contexts = make([]context.Context, 0)
242+
batch.keys = make([]KeyT, 0)
243243
if l.tracer != nil {
244-
batch.spans = make([]trace.Span, 0, l.maxBatch)
244+
batch.spans = make([]trace.Span, 0)
245245
}
246246
}
247247
l.batch = batch

0 commit comments

Comments
 (0)