milvus/pkg/util/timerecord
Li Liu 96c7ef094a
enhance: Go search path optimizations for improved QPS (#47734)
issue: #47827

Key optimizations:
- O(1) task lookup in scheduler via unissuedTasksIndex map 
- Channel→indexed slice in searchSegments, eliminating channel
alloc/sync
- Single segment fast path skipping errgroup/goroutine overhead 
- Single channel fast path in LB policy 
- Shallow copy SearchRequest instead of proto.Clone deep copy 
- Pipeline.String()→p.name in debug log to avoid eager evaluation 
- TimeRecorder: fix double time.Now(), pre-compute logLabel, IsRecording
guard
- Batch 2D array allocation for resultOffsets in search reduce 
- Pre-allocate Scores/Topks slices with nq*topk capacity 
- Replace fmt.Sprint(nodeID) with paramtable.GetStringNodeID() on hot
paths
- Eliminate fmt.Sprintf in CtxElapse calls, use static strings

Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:12:47 +08:00
..
group_checker.go
group_checker_test.go
time_recorder.go enhance: Go search path optimizations for improved QPS (#47734) 2026-02-24 22:12:47 +08:00