You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[4.2-dev] pSpool cached batch reuse is 5–7% slower than v4.2.8 in controlled AB/BA benchmark #32761
On the 4.2-dev snapshot below, the existing BenchmarkCachedBatchReuse is consistently slower than on v4.2.8 in two controlled AB/BA microbenchmark rounds. The regression reproduced with identical benchmark source, identical host/toolchain, -cpu=1, and unchanged memory allocation (240 B/op, 3 allocs/op).
This is a reproducible pSpool microbenchmark regression, not a claim about end-to-end SQL latency or an SLO violation.
pkg/container/pSpool/copy_benchmark_test.go is byte-identical between A and B (git diff --exit-code ... -- <file> returned 0).
Each round used fresh test processes in AB/BA order: A1, B1, B2, A2.
Results
Round
Samples per version
A median
B median
B vs A
Bootstrap 95% CI for B/A median
Initial (-benchtime=300ms -count=8)
16
732.05 ns/op
769.25 ns/op
+5.08%
[1.0278, 1.0996]
Confirmation (-benchtime=100000x -count=12)
24
749.80 ns/op
802.00 ns/op
+6.96%
[1.0290, 1.1176]
Confirmation-round same-version median drift was small: A1→A2 -1.70%, B1→B2 +1.75%.
Confirmation-round run-level distribution (not query latency percentiles):
Version
p95 run ns/op
p99 run ns/op
Median throughput
A
807.18
812.18
1,333,689 ops/s
B
883.29
920.51
1,246,883 ops/s
Both rounds reported 240 B/op and 3 allocs/op for both versions, so the observed delta is CPU/time rather than an allocation-count regression in this benchmark.
Reproduction
Run in each worktree using the repository CGo test wrapper:
Repeat in AB/BA order (A1 B1 B2 A2) rather than inferring performance from one run.
Request
Please investigate the source of the 4.2-dev slowdown and determine whether the cached-batch reuse path can retain its correctness fixes without this measurable time regression.
Evidence retained
Local QA evidence under /Users/xupeng/qa_plan/evidence/performance/:
Closure evidence for "not repro": re-ran the exact benchmark from this issue on the same host in AB/BA order.
Source: pkg/container/pSpool/copy_benchmark_test.go is byte-identical between v4.2.8 (10d204b) and current 4.2-dev (71e2233) — git diff --exit-code returns 0.
Command: repository CGo wrapper, -bench ^BenchmarkCachedBatchReuse$ -benchtime=100000x -count=12 -cpu=1 -benchmem, fresh process per round, order A1 (v4.2.8), B1 (4.2-dev), B2 (4.2-dev), A2 (v4.2.8); 24 samples per version.
Result: v4.2.8 combined median 1028.5 ns/op vs 4.2-dev 1020.5 ns/op (B/A = 0.992, i.e. -0.78%). Allocation profile unchanged on both sides: 240 B/op, 3 allocs/op.
Boundary note: this rerun is linux/amd64 (Ryzen 9 7900X, Go 1.27.1), not the original macOS arm64 host. Reopen if a controlled macOS arm64 AB/BA round shows the regression again.
Activity
XuPeng-SH commentedon Nov 19, 2026
not repro
XuPeng-SH commentedon Nov 19, 2026
Closure evidence for "not repro": re-ran the exact benchmark from this issue on the same host in AB/BA order.
pkg/container/pSpool/copy_benchmark_test.gois byte-identical between v4.2.8 (10d204b) and current 4.2-dev (71e2233) —git diff --exit-codereturns 0.-bench ^BenchmarkCachedBatchReuse$ -benchtime=100000x -count=12 -cpu=1 -benchmem, fresh process per round, order A1 (v4.2.8), B1 (4.2-dev), B2 (4.2-dev), A2 (v4.2.8); 24 samples per version.Boundary note: this rerun is linux/amd64 (Ryzen 9 7900X, Go 1.27.1), not the original macOS arm64 host. Reopen if a controlled macOS arm64 AB/BA round shows the regression again.