Repository navigation
perf(algo): pre-size heap in internalMergeSortWithBuffer - #9715
Conversation
8cec1aa to
4e2d1a4
Compare
4e2d1a4 to
414d90b
Compare
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Build the heap slice and call heap.Init (O(n)) instead of n×heap.Push (per-element interface boxing). BenchmarkMergeSorted/MergeSorted (10000 lists × 100 uids): allocs/op 20.02k -> 10.01k (-50.03%, p=0.002) B/op 11.46Mi -> 8.86Mi (-22.70%, p=0.002)
414d90b to
0f6732c
Compare
Build the heap slice and call
heap.Init(O(n)) instead of n×heap.Push(per-element interface boxing).BenchmarkMergeSorted/MergeSorted(10000 lists × 100 uids): allocs/op 20.02k→10.01k (-50%), B/op 11.46Mi→8.86Mi (-22.7%).Independent change; branched from
4b9b399d(no dependency on the other PRs in this set). Verified: package unit tests pass + Go benchmark (benchstat, p<0.01). Numbers are single-thread microbenchmarks; not yet run through the Docker integration suite.Summary by CodeRabbit