Skip to content

perf(parser,gosqlx): reserve the parse stack once before tokenizing [W1-04] - #940

Merged
ajitpratap0 merged 14 commits into
mainfrom
perf/w1-04-stack-pregrow
Nov 15, 2026
Merged

ajitpratap0 merged 14 commits into
mainfrom
perf/w1-04-stack-pregrow

Conversation

@ajitpratap0

@ajitpratap0 ajitpratap0 commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

A parse on a brand-new goroutine grew its stack 2 -> 4 -> 8 (-> 16) KiB inside the parse; for a ~1 us statement the 2-3 copies cost more than the parse. internal/stackgrow.Reserve() (12 KiB frame, lands a fresh goroutine at 16 KiB, no-op ~1 ns afterwards) now runs first in tokscratch.Bytes/String/StringContext (covers every internal tokenize-then-parse pipeline), in four public-tokenizer pipelines (ParseBytesWithTokens, Analyze, LintString, LSP parseWithRecoveryForDialect) and as a backstop in the parser core (parseTokens, parseContextTokens, parseWithRecovery). No output, allocs/op or B/op change; no public API (D18).

Memory: a goroutine that parses keeps >= 16 KiB stack until exit/GC shrink (before 4-16 KiB; Windows lands at 32 KiB). Coverage over the 2,999-statement corpus: 99.90% need no further copy.

Also: BenchmarkParseFreshRW (evidence for the 16 KiB class on real-world SQL) and the CI non-race step now runs AllocBudget|StackBudget|StackReserve for ./pkg/gosqlx; ./internal/stackgrow (including TestReserveAvoidsLaterCopies, which is not race-skipped) runs under task test:race, so no workflow change is needed for it.

Test Plan

  • go build ./..., GOOS=js GOARCH=wasm go build ./wasm/: pass

  • go test -count=1 -run 'StackReserve|StackBudget|EntryPoints|NoUnreserved|Reserve' ./internal/stackgrow ./pkg/gosqlx (non-race and -race): pass; real-world coverage 2996/2999

  • go test -count=1 -run 'AllocBudget|StackBudget|StackReserve' ./pkg/gosqlx ./internal/stackgrow: pass

  • task test:cbinding, go test ./pkg/compatibility/..., staticcheck on changed packages: pass

  • task check: format/vet/lint clean; the race run hit the 2m timeout and timing-ratio flakes (TestJoinWithComments_ScalesLinearly, TestTranspileDeepChainLinear, parser/security/tokenizer timeouts) while the M4 was at load 50-114. Re-run: parser, security, tokenizer, transpiler pass; pkg/formatter passes alone and flaked once more under the full-tree run (B/op ratio 4.31 within bound; only the wall-clock ratio missed). No test, threshold or timeout was changed.

  • Mutation checks (by Codex): reserveBytes=16<<10 fails T2, 5<<10 fails T4, never as const fails T1, dropping the Reserve in tokscratch.String fails T5.

  • Local task bench:ab BASE=origin/main BENCH='./pkg/gosqlx=^BenchmarkParseFresh$' ROUNDS=8 LAYOUTS=0 BENCHTIME=200ms (arm64 M4, load 50+, indicative only): geomean -64.88%; simple_select -79.8%, aggregate -74.1%, subquery -68.0%; other cells directionally lower but noisy (+-80%). allocs/op and B/op identical in every cell.

  • CI perf-gate (ci(perf): randomize code layout in the A/B perf gate so layout noise cannot read as a regression #934, amd64 EPYC 7763, 20 interleaved rounds x 20 randomized layouts per arm, per-layout Mann-Whitney U, A/A', BH). Authoritative; local M4 numbers are indicative only. The gate suite now includes ParseFresh insert/update/delete (scripts/perf/gate-suite.txt), so the short-DML targets are gated.

    Run 1 (base 6399dc0, head merge 58e1cfa): PASS. simple_select -58.73%, join -43.63%, complex -23.54% (all p<0.001, A/A' about -0.2%); instructions/op -60.5%, -42.0%, -24.2%; no gated time regression; allocs/op and B/op unchanged; suite geomean -2.96%; A/A' moved 0 of 52 benchmarks; no target in the Low-power list.

    Run 2 (base a72ec74 = current main, head 21e8482, includes insert/update/delete):

    benchmark time p A/A' B/op allocs/op
    ParseFresh/simple_select -58.54% <0.001 +0.33% +0.00% 6 -> 6
    ParseFresh/join -43.35% <0.001 +0.58% +0.00% 18 -> 18
    ParseFresh/complex -23.29% <0.001 -0.11% +0.00% 50 -> 50
    ParseFresh/insert -56.94% <0.001 +0.01% +0.00% 18 -> 18
    ParseFresh/update -59.37% <0.001 -0.07% +0.00% 14 -> 14
    ParseFresh/delete -66.13% <0.001 +0.44% +0.00% 6 -> 6

    Suite geomean -7.69% (p<0.001); A/A' 0 of 55 moved, geomean -0.02%.

    Run 3 (base 6d29d68, head merge cedf5d2 = PR head e92c248; latest authoritative run before the final main merge): simple_select -60%, join -39.74%, complex -23%, insert -57%, update -60%, delete -67% (all p<0.001); suite geomean -7.99%; A/A' moved 0 of 55; Low-power list empty; allocs/op and B/op unchanged; instructions/op within +0.28%; ParseE2E within +/-1%.

    Run 4 (head 996ce7b, after the final origin/main merge; the PR head 9d316a0 adds only a test-only commit): PASS. simple_select -58.1%, join -43.9%, complex -26.1%, insert -56.0%, update -58.4%, delete -65.3% (ParseFresh); suite geomean -7.56%; allocs/op and B/op unchanged; instructions/op at most +0.39%; A/A' moved 0 of 55; LintRW/LintParallel within +/-1.1%.
    Run 5 (PR head 9d316a0, merge 52f4e44 vs base 8889402, run 42332405535, Intel Xeon Platinum 8573C; attempt 1 and re-run attempt 2 both on this CPU type; sticky comment 6611443891, latest = attempt 2): REGRESSION flagged on PoolGetPut/serial +4.78% (p<0.001, A/A' -0.23%, spread 0.70%; attempt 1 +4.58%; benchstat 95.94n -> 100.40n). Everything else: ParseFresh simple_select -60.08%, join -43.27%, complex -22.98%, insert -57.10%, update -59.70%, delete -67.11% (all p<0.001); suite geomean -7.79%; allocs/op and B/op unchanged; instructions/op at most +0.38% (the instructions table does not cover PoolGetPut); A/A' moved 0 of 55. The regression reproduces on re-run, so it is REPORTED, not hidden. Cause is NOT proven: PoolGetPut only calls GetTokenizer/GetParser/NewAST/Release/Put and none of them calls stackgrow.Reserve; run 4 (AMD EPYC 9V74, same non-test code) showed -0.05% (p=0.579); local M4 A/B (6x3 runs, GOMAXPROCS=1) shows 28.27 vs 28.16 ns (-0.4%). The only data symbol that moved between base and head in an amd64 build is ast.poolLeakCount (offset in its 64-byte line 16 -> 48), which sits on the NewAST/ReleaseAST path, so a data-layout effect on Intel is the working hypothesis; -randlayout randomizes code layout only. Merge decision for the maintainer: ParseFresh gains are large and significant, PoolGetPut is a pool micro-benchmark whose code is untouched, but the rule allows no gated time regression.
    Run 6 (PR head b085e53 = merge a70d80d vs base 79774dd, AMD EPYC 7763, sticky comment 6611443891 updated 2026-11-07T08:53Z; latest authoritative run before the final origin/main re-merge): PASS. ParseFresh simple_select -58.29%, join -43.86%, complex -24.60%, insert -56.62%, update -59.09%, delete -66.17% (all p<0.001, A/A' under 0.6%); PoolGetPut/serial -0.21% (p=0.665), so the Run 5 PoolGetPut flag did not reproduce on EPYC (it was Intel-specific or a data-layout effect and is not a gated regression on the latest run); every ParseE2E cell within +/-1% (PLAN +/-2% condition met); allocs/op and B/op unchanged; A/A' moved 0 of 55; suite geomean -7.95%; the Low-power list holds only LintRW/snowflake, which is not a target. ParseFresh/complex still misses the PLAN -40% threshold and that stays reported.
    Run 7 (latest, PR head 270dab8 = merge f398b01 vs base fb63e32, AMD EPYC 7763, after merging chore(changelog): per-PR changelog fragments to stop CHANGELOG.md conflicts #961): PASS. ParseFresh simple_select -58.69%, join -43.72%, complex -24.65%, insert -57.03%, update -59.30%, delete -66.38% (all p<0.001, A/A' under 0.7%); PoolGetPut/serial -0.31% (p=0.172); ParseE2E within +/-1%; TransformParse +1.0% to +2.1% (p 0.01-0.05, below the 3% gate threshold, status ok); allocs/op and B/op unchanged. All CI checks green.

    Gate noise, reported not hidden: the shadow verdict reads "regression" in both PR-head runs for reasons unrelated to this change. Run (base a72ec74, head 4e90e34) flagged ParseRW/clickhouse/medium +3.22% (A/A' +2.18%, Low-power list, instructions/op -0.91%); it did not reproduce in run 2 (-0.30%, p=0.735) nor in run 1 (PASS). Run 2 flagged LintRW/postgresql allocs/op 34189 -> 34190 (+1 in 34k; run 1 measured 34189.5 -> 34189, so this is pool/GC amortization jitter in a benchmark whose Lint path this change does not touch).

  • PLAN W1-04 threshold (BenchmarkParseFresh/* <= -40%) is NOT fully met: ParseFresh/complex reaches only -22.7% to -26.1% on amd64 across six runs (-24.60% in the latest) (the remaining cost is parse work, not stack growth), and ParseFresh/join is noise-limited around the target: -39.7% (run 3), -43.6%, -43.4% and -43.9% (run 4), -43.3% (run 5, latest) across five runs, so it meets -40% in four of five. simple_select, insert, update and delete meet it in every run. The W3-06 trigger ("complex above 1.0x Vitess") still has to be re-checked against this result.

Open decisions (recommended defaults implemented): M1 16 KiB landing; M2(a) implemented: scripts/perf/gate-suite.txt is widened, so the short-DML cells (insert/update/delete) are in the gated suite.

Breaking Changes

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2

Merge state: merged with origin/main fb63e32 (changelog fragments #961); entries live in changelog.d/w1-04-stack-pregrow.*.md; all CI checks green, PR mergeable.

Final gate before merge (merge train)

The perf gate ran on the final head e74a01b1abaf merged with current main: ## Perf gate: PASS (shadow mode: report only, this check never fails), report #940 (comment). This result replaces any earlier gate numbers in this description.

…W1-04]

A parse on a fresh goroutine grew its stack 2 -> 4 -> 8 (-> 16) KiB inside
the parse. internal/stackgrow.Reserve (12 KiB frame, lands at 16 KiB) now
runs first in tokscratch, four public-tokenizer pipelines and the parser
core, so the stack is copied once while shallow. No output, allocs/op or
B/op change; no public API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
gosqlx-website Ignored Ignored Preview Nov 15, 2026 12:06pm UTC

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 24s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the diff of the single commit. I did not build or run the tests in this job. The test results below come from the PR description.

Verdict: the approach is sound and the change is small and well contained. I have no blocking issues, only a few non-blocking points.

What I checked

  • internal/stackgrow.Reserve (stackgrow.go)
    • The 12 KiB frame is above the compiler's "big frame" threshold, so the prologue forces a morestack call. //go:noinline on both Reserve and sink keeps the frame from being inlined away.
    • Taking &buf and passing it to a noinline callee doesn't make the array escape, so it stays on the stack. The array is never zeroed because never is never true. The mutation checks in the test plan (never as a const fails T1) confirm this is guarded.
    • Because the package is internal, there is no API surface or compatibility concern.
  • Call sites
    • tokscratch.Bytes/String/StringContext cover the internal pipelines.
    • The four public pipelines and the three parser-core backstops add one call each.
    • When the stack is already large enough, Reserve is a call and a compare, about 1 ns.
  • Pooling and concurrency: nothing here touches the pooled tokenizer, parser or AST objects, so the pooling and race-freedom rules in CLAUDE.md are unaffected.
  • CI: the non-race step now runs AllocBudget|StackBudget|StackReserve. That fits the repo's rule that stack and alloc budgets skip under -race.

Non-blocking suggestions

  1. Fragility across toolchains. The benefit depends on the Go runtime's stack-growth policy (doubling from 2 KiB, with the StackBig/StackSmall thresholds) and on the compiler not optimizing the frame away. The tests catch regressions, but they assert a landing size. A Go upgrade could change the landing class (the package doc already notes Windows 32 KiB and race 16-32 KiB). Make sure the stack-reserve tests fail with a clear message that points at the doc comment when that happens, not only on a bare size mismatch.
  2. Memory trade-off. Every goroutine that parses now keeps at least 16 KiB until it exits or a GC shrink. This is documented in the CHANGELOG. For servers that spawn a goroutine per request and parse once, it adds roughly 4-14 KiB per goroutine. For a library that is often used that way, a short "Memory" note in docs/PERFORMANCE_METHODOLOGY.md or the user docs would be worth adding. Worker pools see no change.
  3. Redundant Reserve calls. LintString, Analyze and LSP parseWithRecoveryForDialect call Reserve, and then reach the tokscratch or parser-core call again. The repeat cost is about 1 ns and the layering is intentional, so this is fine. A one-line comment at those sites ("entry reserve; core also backstops") would help the next reader. Only the parser sites carry one today.
  4. CHANGELOG.md placement. The entry is under ### Performance, which is correct. The text is long. The "amd64 gate numbers are in the PR" placeholder needs real numbers or the sentence removed before release, since the CHANGELOG outlives the PR.
  5. Evidence.
    • The local A/B result (-64.88% geomean) was measured at load 50-114 on the M4 and is flagged as indicative. The amd64 perf-gate verdict is the real evidence per the repo's "measure, don't assume" principle, so please wait for it before merging.
    • Short DML (insert/update/delete) is where the gain is largest, and those cells are not in gate-suite.txt (decision M2). I'd lean toward widening the suite so a future regression here is gated.
  6. Test flakes noted in the PR body. The timing-ratio flakes (TestJoinWithComments_ScalesLinearly, TestTranspileDeepChainLinear, formatter wall-clock ratio) were seen under heavy machine load and are unrelated to this change. A clean CI run of task test:race is still worth confirming before merge.

Security

No new input handling, no unsafe, and no new allocations of attacker-controlled size. The reserved size is a compile-time constant. No concerns.

Test coverage

Coverage looks thorough. It includes the entry-point enumeration test (NoUnreserved), the corpus coverage check (2996/2999), the budget tests and the mutation checks.

Overall this looks good to merge once the amd64 perf gate confirms the gain.

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci-cd lsp parser linter labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Perf gate: PASS (shadow mode: report only, this check never fails)

Base 88ca994b6685, head ac7abff1bfb8. 20 interleaved rounds, 20 randomized code layouts per arm (-randlayout seeds 437121365412..437121365431; A/A' 437121365432..437121365451), benchtime 100ms, -cpu 1, GOMEMLIMIT 64MiB, pinned to CPU 3 (SMT siblings 1,3) with taskset.

Runner CPU: Intel(R) Xeon(R) 6975P-C (x86_64). Base and head ran interleaved in this job, so the tables show their ratios only; absolute timings (raw files in the artifact) hold for this CPU and this job alone and are never compared across jobs.

  • 6 benchmark(s) faster by 3% or more

Rules: each arm runs 20 randomized code layouts (-ldflags=-randlayout); time regresses at >= +3% when significant at a false discovery rate of 0.01 over the suite (Benjamini-Hochberg on exact Mann-Whitney U p-values of the per-layout medians, so a regression must hold across layouts, not within one binary), or a suite geomean >= +1.5% (per-layout suite geomeans, same test); allocs/op must not increase; B/op must not rise more than 2%; instructions/op must not rise more than 1.5%. The A/A' control runs the base revision under a disjoint set of layout seeds; when more than 10% of benchmarks move over 3% in it, the run is noisy: re-run once, then inconclusive (neutral).

Gated suite (GOGC=off, GOMAXPROCS=1)

benchmark time p A/A' spread B/op allocs/op status
ParseE2E/simple_select +0.52% 0.036 +0.25% 0.88% +0.00% 3 → 3 ok
ParseE2E/select_where -0.23% 0.516 +0.56% 1.36% +0.00% 16 → 16 ok
ParseE2E/join +0.00% 1.000 -0.32% 2.17% +0.00% 15 → 15 ok
ParseE2E/aggregate -0.25% 0.665 -0.42% 2.09% +0.00% 13 → 13 ok
ParseE2E/subquery +0.38% 0.365 -0.05% 1.81% +0.00% 10 → 10 ok
ParseE2E/cte -0.21% 0.685 -0.28% 0.93% +0.00% 16 → 16 ok
ParseE2E/window -0.11% 0.892 +0.03% 1.95% +0.00% 9 → 9 ok
ParseE2E/complex -0.01% 0.989 +0.67% 1.04% +0.00% 43 → 43 ok
ParseE2E/insert -0.19% 0.655 +0.52% 1.44% +0.00% 17 → 17 ok
ParseE2E/update +0.00% 0.957 +0.11% 1.77% +0.00% 13 → 13 ok
ParseE2E/delete +0.72% 0.285 +0.59% 4.73% +0.00% 5 → 5 ok
ParseRW/postgresql/medium -0.50% 0.221 +0.21% 1.82% +0.00% 583 → 583 ok
ParseRW/mysql/medium -0.16% 0.799 +0.57% 1.15% +0.00% 334 → 334 ok
ParseRW/mariadb/medium -1.20% 0.033 -1.53% 1.84% -0.00% 470 → 470 ok
ParseRW/sqlserver/medium -0.44% 0.327 -0.02% 1.55% +0.00% 853 → 853 ok
ParseRW/oracle/medium +0.28% 0.565 +0.32% 1.37% +0.00% 962 → 962 ok
ParseRW/sqlite/medium -0.23% 0.565 +0.23% 1.46% +0.00% 318 → 318 ok
ParseRW/snowflake/medium -0.26% 0.583 -0.10% 1.36% +0.00% 630 → 630 ok
ParseRW/clickhouse/medium -0.33% 0.659 -0.43% 2.76% +0.00% 336 → 336 ok
ParseFresh/simple_select -61.68% <0.001 -0.59% 1.64% +0.00% 4 → 4 faster
ParseFresh/join -39.33% <0.001 -0.32% 0.84% +0.00% 16 → 16 faster
ParseFresh/complex -23.46% <0.001 -0.34% 0.91% +0.00% 44 → 44 faster
ParseFresh/insert -57.82% <0.001 -0.32% 1.27% +0.00% 18 → 18 faster
ParseFresh/update -60.82% <0.001 -0.84% 1.89% +0.00% 14 → 14 faster
ParseFresh/delete -68.20% <0.001 -0.75% 1.24% +0.00% 6 → 6 faster
PoolGetPut/serial -0.28% 0.267 -0.27% 0.92% +0.00% 0 → 0 ok
Tokenize/scratch/join -1.04% 0.256 -0.34% 3.72% +0.00% 0 → 0 ok
Tokenize/scratch/complex -1.15% 0.176 -0.81% 3.13% +0.00% 0 → 0 ok
Tokenize/scratch/insert -1.17% 0.213 -1.33% 2.91% +0.00% 0 → 0 ok
Normalize/simple_select +0.79% 0.365 +0.55% 2.86% +0.00% 5 → 5 ok
Normalize/join -0.32% 0.245 -0.16% 0.88% +0.00% 21 → 21 ok
Normalize/complex -0.20% 0.588 +0.78% 1.43% +0.00% 62 → 62 ok
TransformParse/simple_select +0.18% 0.735 -0.79% 0.71% +0.00% 3 → 3 ok
TransformParse/join +0.55% 0.223 +0.03% 1.45% +0.00% 15 → 15 ok
TransformParse/complex -0.04% 0.947 -0.21% 1.68% +0.00% 43 → 43 ok
LintParallel/rules +0.19% 0.620 +0.16% 1.09% +0.00% 68933 → 68933 ok
LintParallel/lint +0.17% 0.398 +0.31% 0.86% -0.00% 126676.5 → 126676.5 ok
LintRW/postgresql -0.10% 0.583 +0.29% 0.96% +0.00% 14129 → 14129 ok
LintRW/mysql +0.14% 0.495 +0.08% 0.62% +0.00% 17456 → 17456 ok
LintRW/mariadb -0.38% 0.355 -0.37% 1.10% -0.00% 15755 → 15755 ok
LintRW/sqlserver -0.22% 0.698 +0.26% 2.51% +0.00% 13870 → 13870 ok
LintRW/oracle -0.23% 0.738 -0.32% 1.68% -0.00% 16857 → 16857 ok
LintRW/sqlite -0.39% 0.445 +0.56% 1.79% +0.00% 15738 → 15738 ok
LintRW/snowflake -0.16% 0.659 +0.29% 1.38% +0.00% 15204 → 15204 ok
LintRW/clickhouse -0.16% 0.698 +0.15% 1.54% -0.00% 17660 → 17660 ok
LintRule/L007 +0.52% 0.414 +0.38% 3.12% +0.00% 1194 → 1194 ok
LintRule/L010 -0.35% 0.314 +0.13% 6.49% +0.00% 0 → 0 ok
ParseError/syntax_mid/parse -0.17% 0.839 +0.21% 1.98% +0.00% 11 → 11 ok
ParseError/syntax_mid/validate -0.63% 0.297 +0.07% 2.53% +0.00% 11 → 11 ok
ParseError/syntax_end/parse -0.56% 0.234 -0.37% 1.71% +0.00% 14 → 14 ok
ParseError/syntax_end/validate -1.99% 0.013 -1.29% 1.61% +0.00% 14 → 14 ok
ParseError/tokenize/parse -0.25% 0.534 +0.06% 1.08% +0.00% 4 → 4 ok
ParseError/tokenize/validate -1.25% 0.033 +0.23% 1.92% +0.00% 21 → 21 ok
ParseError/long_prefix/parse -0.26% 0.379 -0.30% 0.72% +0.01% 213 → 213 ok
ParseError/long_prefix/validate -1.52% 0.046 -1.10% 3.44% +0.00% 213 → 213 ok
DetectDialect/empty +0.08% 0.786 -0.08% 0.57% +0.00% 0 → 0 ok
DetectDialect/generic -0.26% 0.465 -0.62% 1.19% +0.00% 0 → 0 ok
DetectDialect/postgresql +0.11% 0.871 -0.77% 3.80% +0.00% 0 → 0 ok
DetectDialect/mysql -0.42% 0.387 -0.91% 1.00% +0.00% 0 → 0 ok
DetectDialect/sqlserver -0.34% 0.181 -0.69% 0.69% +0.00% 0 → 0 ok
DetectDialect/oracle -0.34% 0.379 -1.04% 1.30% +0.00% 0 → 0 ok
DetectDialect/snowflake -0.41% 0.245 -0.37% 0.89% +0.00% 0 → 0 ok
DetectDialect/mariadb -0.52% 0.285 -0.86% 1.49% +0.00% 0 → 0 ok
DetectDialect/mixed -0.18% 0.579 -0.05% 1.07% +0.00% 0 → 0 ok
DetectDialect/large_64KB +0.03% 0.758 -0.17% 0.32% +0.00% 0 → 0 ok
geomean -7.15% <0.001 -0.17%

time and A/A' are Hodges-Lehmann shifts over the per-layout medians. spread: the base arm's robust standard deviation across its layouts (1.4826 x MAD, relative), i.e. how much this benchmark moves between builds that differ only in function placement, plus run-to-run noise; a change much smaller than it cannot be resolved in one run.

A/A' control (base revision, disjoint layout seeds): 0 of 65 benchmarks moved more than 3%; 0 would have been flagged by the time rule; suite geomean -0.17%, p 0.242.

Low power

5 benchmark(s) have under 80% estimated power to be flagged on their own for a +5% slowdown (their spread across layouts is too wide for 20 layouts at the Benjamini-Hochberg level alpha/m = 0.000154). A slowdown below the last column usually goes unflagged there; instructions/op, allocs/op and the suite geomean still guard them.

benchmark spread power at +5% slowdown caught 80% of the time
LintRule/L010 6.49% 7% +10.2%
ParseE2E/delete 4.73% 28% +7.3%
DetectDialect/postgresql 3.80% 57% +5.8%
Tokenize/scratch/join 3.72% 60% +5.7%
ParseError/long_prefix/validate 3.44% 73% +5.3%

Power is estimated with the normal approximation for the U test (Noether): power = Phi(ln(1+shift)/s * sqrt(K/2) * sqrt(3/pi) - z(1 - alpha/(2m))), with s the spread and K the layouts per arm.

Instructions per operation (cmd/perfdriver)

case instructions/op status
e2e/aggregate +0.14% ok
e2e/complex -4.26% ok
e2e/cte +0.09% ok
e2e/delete +0.31% ok
e2e/insert +0.15% ok
e2e/join +0.09% ok
e2e/select_where +0.12% ok
e2e/simple_select +0.30% ok
e2e/subquery +0.13% ok
e2e/update +0.17% ok
e2e/window +0.11% ok
rw/postgresql/medium +0.00% ok
Secondary metric: default GC, GOMAXPROCS=1 (informational)
benchmark time p
ParseE2E/simple_select -0.09% 0.910
ParseE2E/select_where -0.13% 0.853
ParseE2E/join -0.01% 1.000
ParseE2E/aggregate +0.00% 1.000
ParseE2E/subquery +0.00% 0.970
ParseE2E/cte +0.10% 0.739
ParseE2E/window +0.22% 0.820
ParseE2E/complex +0.37% 0.520
ParseE2E/insert -0.02% 1.000
ParseE2E/update -0.08% 0.912
ParseE2E/delete +0.00% 1.000
ParseRW/postgresql/medium -0.74% 0.019
ParseRW/mysql/medium -0.72% 0.190
ParseRW/mariadb/medium -0.94% 0.052
ParseRW/sqlserver/medium -0.35% 0.853
ParseRW/oracle/medium -0.25% 0.853
ParseRW/sqlite/medium -0.27% 0.529
ParseRW/snowflake/medium -1.42% 0.019
ParseRW/clickhouse/medium -0.84% 0.063
ParseFresh/simple_select -62.70% <0.001
ParseFresh/join -40.80% <0.001
ParseFresh/complex -23.40% <0.001
ParseFresh/insert -57.87% <0.001
ParseFresh/update -61.16% <0.001
ParseFresh/delete -68.92% <0.001
PoolGetPut/serial -0.43% 0.218
Tokenize/scratch/join -2.33% 0.037
Tokenize/scratch/complex -2.83% 0.019
Tokenize/scratch/insert -2.54% 0.052
Normalize/simple_select +0.68% 0.325
Normalize/join +0.15% 0.739
Normalize/complex -0.03% 0.910
TransformParse/simple_select +0.80% 0.280
TransformParse/join +0.00% 1.000
TransformParse/complex +0.25% 0.971
LintParallel/rules -0.29% 0.971
LintParallel/lint +0.19% 0.579
LintRW/postgresql -0.25% 0.393
LintRW/mysql -0.07% 0.912
LintRW/mariadb +0.24% 0.631
LintRW/sqlserver -0.22% 0.481
LintRW/oracle +0.24% 0.529
LintRW/sqlite -0.12% 0.529
LintRW/snowflake -0.09% 0.853
LintRW/clickhouse -0.16% 0.631
LintRule/L007 +0.64% 0.393
LintRule/L010 -0.07% 0.853
ParseError/syntax_mid/parse -0.89% 0.472
ParseError/syntax_mid/validate -0.29% 0.880
ParseError/syntax_end/parse +0.07% 1.000
ParseError/syntax_end/validate -0.57% 0.427
ParseError/tokenize/parse +0.07% 0.912
ParseError/tokenize/validate -0.23% 0.739
ParseError/long_prefix/parse +0.38% 0.631
ParseError/long_prefix/validate +0.82% 0.247
DetectDialect/empty +0.08% 0.879
DetectDialect/generic +0.27% 0.596
DetectDialect/postgresql +0.06% 1.000
DetectDialect/mysql -0.11% 0.734
DetectDialect/sqlserver +0.06% 0.850
DetectDialect/oracle +0.32% 0.520
DetectDialect/snowflake -0.33% 0.579
DetectDialect/mariadb -0.22% 0.820
DetectDialect/mixed +0.63% 0.063
DetectDialect/large_64KB +0.02% 0.971
geomean -7.22%
Environment
date:        2026-11-15T12:10:04Z
base:        88ca994b6685522aaea35fb971b83fdc03eb55b1
head:        working tree of ac7abff1bfb8e8fbf22fe6696860ed94db02e20f
cpu model:   Intel(R) Xeon(R) 6975P-C (x86_64)
go:          go version go1.26.9 linux/amd64
kernel:      Linux 7.0.0-1014-aws x86_64
layouts:     20 per arm, -ldflags=-randlayout seeds 437121365412..437121365431 (base, head), 437121365432..437121365451 (A/A')
pinning:     pinned to CPU 3 (SMT siblings 1,3) with taskset
gcoff env:   GOGC=off GOMEMLIMIT=64MiB
clocksource: tsc
load:        6.24, 2.29, 0.84
instr count: perf
perf probe:  205233,,instructions:u,293837,100.00,, 

Architecture:                            x86_64
CPU(s):                                  4
Model name:                              Intel(R) Xeon(R) 6975P-C
Thread(s) per core:                      2
Core(s) per socket:                      2
Socket(s):                               1
Hypervisor vendor:                       KVM
L1d cache:                               96 KiB (2 instances)
L1i cache:                               128 KiB (2 instances)
L2 cache:                                4 MiB (2 instances)
L3 cache:                                480 MiB (1 instance)
benchstat (primary metric, samples pooled across layouts: informational, the verdict uses the per-layout test)
goos: linux
goarch: amd64
pkg: github.com/ajitpratap0/GoSQLX/pkg/fingerprint
cpu: Intel(R) Xeon(R) 6975P-C
                        │    base     │                head                │
                        │   sec/op    │   sec/op     vs base               │
Normalize/simple_select   1.270µ ± 2%   1.274µ ± 2%       ~ (p=0.365 n=20)
Normalize/join            4.899µ ± 1%   4.886µ ± 1%       ~ (p=0.245 n=20)
Normalize/complex         13.15µ ± 1%   13.15µ ± 1%       ~ (p=0.588 n=20)
geomean                   4.341µ        4.341µ       -0.01%

                        │     base     │                 head                  │
                        │     B/op     │     B/op      vs base                 │
Normalize/simple_select     784.0 ± 0%     784.0 ± 0%       ~ (p=1.000 n=20) ¹
Normalize/join            2.164Ki ± 0%   2.164Ki ± 0%       ~ (p=1.000 n=20) ¹
Normalize/complex         5.977Ki ± 0%   5.977Ki ± 0%       ~ (p=1.000 n=20) ¹
geomean                   2.147Ki        2.147Ki       +0.00%
¹ all samples are equal

                        │    base    │                head                 │
                        │ allocs/op  │ allocs/op   vs base                 │
Normalize/simple_select   5.000 ± 0%   5.000 ± 0%       ~ (p=1.000 n=20) ¹
Normalize/join            21.00 ± 0%   21.00 ± 0%       ~ (p=1.000 n=20) ¹
Normalize/complex         62.00 ± 0%   62.00 ± 0%       ~ (p=1.000 n=20) ¹
geomean                   18.67        18.67       +0.00%
¹ all samples are equal

pkg: github.com/ajitpratap0/GoSQLX/pkg/gosqlx
                                │    base     │                head                 │
                                │   sec/op    │   sec/op     vs base                │
ParseE2E/simple_select            835.6n ± 1%   838.7n ± 0%        ~ (p=0.034 n=20)
ParseE2E/select_where             2.179µ ± 1%   2.174µ ± 1%        ~ (p=0.516 n=20)
ParseE2E/join                     3.281µ ± 2%   3.259µ ± 1%        ~ (p=1.000 n=20)
ParseE2E/aggregate                2.379µ ± 1%   2.372µ ± 1%        ~ (p=0.664 n=20)
ParseE2E/subquery                 1.838µ ± 1%   1.842µ ± 1%        ~ (p=0.365 n=20)
ParseE2E/cte                      2.867µ ± 1%   2.859µ ± 1%        ~ (p=0.683 n=20)
ParseE2E/window                   1.787µ ± 1%   1.780µ ± 0%        ~ (p=0.888 n=20)
ParseE2E/complex                  7.930µ ± 1%   7.935µ ± 1%        ~ (p=0.984 n=20)
ParseE2E/insert                   1.543µ ± 1%   1.540µ ± 0%        ~ (p=0.654 n=20)
ParseE2E/update                   1.338µ ± 1%   1.339µ ± 2%        ~ (p=0.952 n=20)
ParseE2E/delete                   808.9n ± 4%   846.1n ± 5%        ~ (p=0.286 n=20)
ParseRW/postgresql/medium         96.80µ ± 2%   96.47µ ± 1%        ~ (p=0.221 n=20)
ParseRW/mysql/medium              59.39µ ± 1%   59.43µ ± 0%        ~ (p=0.799 n=20)
ParseRW/mariadb/medium            85.43µ ± 2%   83.81µ ± 1%        ~ (p=0.033 n=20)
ParseRW/sqlserver/medium          191.7µ ± 1%   191.2µ ± 2%        ~ (p=0.327 n=20)
ParseRW/oracle/medium             236.4µ ± 4%   237.6µ ± 3%        ~ (p=0.565 n=20)
ParseRW/sqlite/medium             50.52µ ± 1%   50.55µ ± 1%        ~ (p=0.565 n=20)
ParseRW/snowflake/medium          131.3µ ± 1%   130.7µ ± 1%        ~ (p=0.583 n=20)
ParseRW/clickhouse/medium         58.41µ ± 2%   58.29µ ± 6%        ~ (p=0.659 n=20)
ParseFresh/simple_select          4.643µ ± 1%   1.775µ ± 1%  -61.78% (p=0.000 n=20)
ParseFresh/join                   7.275µ ± 1%   4.402µ ± 1%  -39.49% (p=0.000 n=20)
ParseFresh/complex                13.55µ ± 1%   10.39µ ± 1%  -23.31% (p=0.000 n=20)
ParseFresh/insert                 6.075µ ± 1%   2.560µ ± 1%  -57.86% (p=0.000 n=20)
ParseFresh/update                 5.963µ ± 1%   2.329µ ± 1%  -60.95% (p=0.000 n=20)
ParseFresh/delete                 5.577µ ± 1%   1.771µ ± 2%  -68.24% (p=0.000 n=20)
PoolGetPut/serial                 71.85n ± 1%   71.66n ± 0%        ~ (p=0.268 n=20)
ParseError/syntax_mid/parse       1.464µ ± 1%   1.453µ ± 2%        ~ (p=0.836 n=20)
ParseError/syntax_mid/validate    1.349µ ± 2%   1.331µ ± 2%        ~ (p=0.298 n=20)
ParseError/syntax_end/parse       1.607µ ± 1%   1.602µ ± 1%        ~ (p=0.234 n=20)
ParseError/syntax_end/validate    1.612µ ± 1%   1.593µ ± 3%        ~ (p=0.012 n=20)
ParseError/tokenize/parse         688.5n ± 1%   685.5n ± 1%        ~ (p=0.533 n=20)
ParseError/tokenize/validate      1.778µ ± 1%   1.756µ ± 1%        ~ (p=0.032 n=20)
ParseError/long_prefix/parse      44.06µ ± 1%   43.92µ ± 0%        ~ (p=0.380 n=20)
ParseError/long_prefix/validate   41.89µ ± 6%   41.09µ ± 1%        ~ (p=0.046 n=20)
geomean                           6.254µ        5.438µ       -13.05%

                                │     base     │                head                 │
                                │     B/s      │     B/s       vs base               │
ParseE2E/simple_select            29.67Mi ± 1%   29.57Mi ± 0%       ~ (p=0.034 n=20)
ParseE2E/select_where             45.09Mi ± 1%   45.20Mi ± 1%       ~ (p=0.490 n=20)
ParseE2E/join                     36.63Mi ± 2%   36.87Mi ± 1%       ~ (p=0.995 n=20)
ParseE2E/aggregate                33.68Mi ± 2%   33.78Mi ± 1%       ~ (p=0.654 n=20)
ParseE2E/subquery                 42.54Mi ± 1%   42.47Mi ± 1%       ~ (p=0.365 n=20)
ParseE2E/cte                      41.25Mi ± 1%   41.37Mi ± 1%       ~ (p=0.673 n=20)
ParseE2E/window                   50.17Mi ± 1%   50.37Mi ± 0%       ~ (p=0.857 n=20)
ParseE2E/complex                  45.46Mi ± 1%   45.43Mi ± 1%       ~ (p=0.973 n=20)
ParseE2E/insert                   47.00Mi ± 1%   47.07Mi ± 0%       ~ (p=0.654 n=20)
ParseE2E/update                   39.20Mi ± 1%   39.19Mi ± 2%       ~ (p=0.920 n=20)
ParseE2E/delete                   61.31Mi ± 4%   58.61Mi ± 6%       ~ (p=0.286 n=20)
ParseRW/postgresql/medium         37.06Mi ± 2%   37.19Mi ± 1%       ~ (p=0.218 n=20)
ParseRW/mysql/medium              45.57Mi ± 1%   45.54Mi ± 0%       ~ (p=0.794 n=20)
ParseRW/mariadb/medium            41.51Mi ± 2%   42.31Mi ± 1%       ~ (p=0.031 n=20)
ParseRW/sqlserver/medium          34.71Mi ± 1%   34.80Mi ± 1%       ~ (p=0.327 n=20)
ParseRW/oracle/medium             35.47Mi ± 4%   35.28Mi ± 3%       ~ (p=0.542 n=20)
ParseRW/sqlite/medium             40.89Mi ± 1%   40.86Mi ± 1%       ~ (p=0.569 n=20)
ParseRW/snowflake/medium          38.72Mi ± 1%   38.90Mi ± 1%       ~ (p=0.597 n=20)
ParseRW/clickhouse/medium         38.58Mi ± 2%   38.66Mi ± 6%       ~ (p=0.654 n=20)
ParseError/syntax_mid/parse       31.28Mi ± 1%   31.52Mi ± 2%       ~ (p=0.836 n=20)
ParseError/syntax_mid/validate    33.93Mi ± 2%   34.40Mi ± 2%       ~ (p=0.304 n=20)
ParseError/syntax_end/parse       23.16Mi ± 1%   23.22Mi ± 1%       ~ (p=0.239 n=20)
ParseError/syntax_end/validate    23.07Mi ± 1%   23.35Mi ± 3%       ~ (p=0.011 n=20)
ParseError/tokenize/parse         63.72Mi ± 1%   63.99Mi ± 1%       ~ (p=0.533 n=20)
ParseError/tokenize/validate      24.67Mi ± 1%   24.98Mi ± 1%       ~ (p=0.034 n=20)
ParseError/long_prefix/parse      52.42Mi ± 1%   52.59Mi ± 0%       ~ (p=0.372 n=20)
ParseError/long_prefix/validate   55.14Mi ± 5%   56.21Mi ± 1%       ~ (p=0.045 n=20)
geomean                           39.16Mi        39.26Mi       +0.26%

                                │      base      │                 head                  │
                                │      B/op      │     B/op      vs base                 │
ParseE2E/simple_select              704.0 ± 0%       704.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/select_where             1.477Ki ± 0%     1.477Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/join                     1.789Ki ± 0%     1.789Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/aggregate                1.719Ki ± 0%     1.719Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/subquery                 1.609Ki ± 0%     1.609Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/cte                      2.070Ki ± 0%     2.070Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/window                   1.234Ki ± 0%     1.234Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/complex                  4.884Ki ± 0%     4.884Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/insert                     824.0 ± 0%       824.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/update                     736.0 ± 0%       736.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/delete                     400.0 ± 0%       400.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/postgresql/medium         64.40Ki ± 0%     64.40Ki ± 0%       ~ (p=0.205 n=20)
ParseRW/mysql/medium              40.70Ki ± 0%     40.70Ki ± 0%       ~ (p=0.487 n=20)
ParseRW/mariadb/medium            58.51Ki ± 0%     58.50Ki ± 0%       ~ (p=0.035 n=20)
ParseRW/sqlserver/medium          81.25Ki ± 0%     81.25Ki ± 0%       ~ (p=0.624 n=20)
ParseRW/oracle/medium             100.9Ki ± 0%     100.9Ki ± 0%       ~ (p=1.000 n=20)
ParseRW/sqlite/medium             37.30Ki ± 0%     37.30Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/snowflake/medium          73.29Ki ± 0%     73.29Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/clickhouse/medium         32.99Ki ± 0%     32.99Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/simple_select            784.0 ± 0%       784.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/join                   1.867Ki ± 0%     1.867Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/complex                4.961Ki ± 0%     4.961Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/insert                   904.0 ± 0%       904.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/update                   816.0 ± 0%       816.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/delete                   480.0 ± 0%       480.0 ± 0%       ~ (p=1.000 n=20) ¹
PoolGetPut/serial                   0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_mid/parse         552.0 ± 0%       552.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_mid/validate      552.0 ± 0%       552.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_end/parse       1.320Ki ± 0%     1.320Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_end/validate    1.320Ki ± 0%     1.320Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseError/tokenize/parse           272.0 ± 0%       272.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/tokenize/validate      1.758Ki ± 0%     1.758Ki ± 0%       ~ (p=1.000 n=20) ¹
ParseError/long_prefix/parse      17.12Ki ± 0%     17.12Ki ± 0%       ~ (p=0.879 n=20)
ParseError/long_prefix/validate   17.07Ki ± 0%     17.07Ki ± 0%       ~ (p=1.000 n=20)
geomean                                        ²                 +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                │     base     │                head                 │
                                │  allocs/op   │ allocs/op   vs base                 │
ParseE2E/simple_select            3.000 ± 0%     3.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/select_where             16.00 ± 0%     16.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/join                     15.00 ± 0%     15.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/aggregate                13.00 ± 0%     13.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/subquery                 10.00 ± 0%     10.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/cte                      16.00 ± 0%     16.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/window                   9.000 ± 0%     9.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/complex                  43.00 ± 0%     43.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/insert                   17.00 ± 0%     17.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/update                   13.00 ± 0%     13.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseE2E/delete                   5.000 ± 0%     5.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/postgresql/medium         583.0 ± 0%     583.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/mysql/medium              334.0 ± 0%     334.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/mariadb/medium            470.0 ± 0%     470.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/sqlserver/medium          853.0 ± 0%     853.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/oracle/medium             962.0 ± 0%     962.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/sqlite/medium             318.0 ± 0%     318.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/snowflake/medium          630.0 ± 0%     630.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseRW/clickhouse/medium         336.0 ± 0%     336.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/simple_select          4.000 ± 0%     4.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/join                   16.00 ± 0%     16.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/complex                44.00 ± 0%     44.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/insert                 18.00 ± 0%     18.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/update                 14.00 ± 0%     14.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseFresh/delete                 6.000 ± 0%     6.000 ± 0%       ~ (p=1.000 n=20) ¹
PoolGetPut/serial                 0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_mid/parse       11.00 ± 0%     11.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_mid/validate    11.00 ± 0%     11.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_end/parse       14.00 ± 0%     14.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/syntax_end/validate    14.00 ± 0%     14.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/tokenize/parse         4.000 ± 0%     4.000 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/tokenize/validate      21.00 ± 0%     21.00 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/long_prefix/parse      213.0 ± 0%     213.0 ± 0%       ~ (p=1.000 n=20) ¹
ParseError/long_prefix/validate   213.0 ± 0%     213.0 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                      ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                          │    base     │                head                │
                          │  sec/stmt   │  sec/stmt    vs base               │
ParseRW/postgresql/medium   8.066µ ± 2%   8.040µ ± 1%       ~ (p=0.218 n=20)
ParseRW/mysql/medium        7.425µ ± 1%   7.429µ ± 0%       ~ (p=0.799 n=20)
ParseRW/mariadb/medium      9.492µ ± 2%   9.312µ ± 1%       ~ (p=0.031 n=20)
ParseRW/sqlserver/medium    9.129µ ± 1%   9.104µ ± 2%       ~ (p=0.327 n=20)
ParseRW/oracle/medium       9.848µ ± 4%   9.901µ ± 3%       ~ (p=0.560 n=20)
ParseRW/sqlite/medium       8.419µ ± 1%   8.425µ ± 1%       ~ (p=0.565 n=20)
ParseRW/snowflake/medium    10.10µ ± 1%   10.05µ ± 1%       ~ (p=0.597 n=20)
ParseRW/clickhouse/medium   8.345µ ± 2%   8.328µ ± 6%       ~ (p=0.654 n=20)
geomean                     8.809µ        8.781µ       -0.32%

pkg: github.com/ajitpratap0/GoSQLX/pkg/linter
                   │    base     │                head                │
                   │   sec/op    │   sec/op     vs base               │
LintParallel/rules   14.75m ± 1%   14.79m ± 1%       ~ (p=0.620 n=20)
LintParallel/lint    27.52m ± 1%   27.58m ± 0%       ~ (p=0.398 n=20)
LintRW/postgresql    3.339m ± 0%   3.334m ± 0%       ~ (p=0.583 n=20)
LintRW/mysql         3.798m ± 0%   3.802m ± 0%       ~ (p=0.495 n=20)
LintRW/mariadb       3.486m ± 1%   3.480m ± 1%       ~ (p=0.355 n=20)
LintRW/sqlserver     3.297m ± 2%   3.308m ± 2%       ~ (p=0.698 n=20)
LintRW/oracle        3.974m ± 1%   3.961m ± 1%       ~ (p=0.738 n=20)
LintRW/sqlite        3.231m ± 1%   3.220m ± 1%       ~ (p=0.445 n=20)
LintRW/snowflake     3.331m ± 1%   3.328m ± 1%       ~ (p=0.659 n=20)
LintRW/clickhouse    3.728m ± 1%   3.731m ± 1%       ~ (p=0.698 n=20)
LintRule/L007        2.201m ± 2%   2.226m ± 2%       ~ (p=0.414 n=20)
LintRule/L010        689.0µ ± 5%   657.0µ ± 9%       ~ (p=0.314 n=20)
geomean              3.947m        3.935m       -0.31%

                  │     base     │                 head                 │
                  │     B/s      │      B/s       vs base               │
LintRW/postgresql   8.478Mi ± 1%    8.492Mi ± 0%       ~ (p=0.596 n=20)
LintRW/mysql        8.612Mi ± 0%    8.607Mi ± 0%       ~ (p=0.532 n=20)
LintRW/mariadb      8.750Mi ± 1%    8.769Mi ± 1%       ~ (p=0.351 n=20)
LintRW/sqlserver    9.398Mi ± 2%    9.370Mi ± 2%       ~ (p=0.693 n=20)
LintRW/oracle       9.999Mi ± 1%   10.028Mi ± 1%       ~ (p=0.703 n=20)
LintRW/sqlite       8.879Mi ± 1%    8.912Mi ± 1%       ~ (p=0.440 n=20)
LintRW/snowflake    9.365Mi ± 1%    9.375Mi ± 1%       ~ (p=0.615 n=20)
LintRW/clickhouse   8.707Mi ± 1%    8.702Mi ± 1%       ~ (p=0.693 n=20)
geomean             9.011Mi         9.019Mi       +0.09%

                   │      base      │                 head                  │
                   │      B/op      │     B/op      vs base                 │
LintParallel/rules   5.559Mi ± 0%     5.559Mi ± 0%       ~ (p=0.380 n=20)
LintParallel/lint    17.95Mi ± 0%     17.95Mi ± 0%       ~ (p=0.425 n=20)
LintRW/postgresql    1.966Mi ± 0%     1.966Mi ± 0%       ~ (p=0.223 n=20)
LintRW/mysql         2.508Mi ± 0%     2.508Mi ± 0%       ~ (p=0.176 n=20)
LintRW/mariadb       2.280Mi ± 0%     2.280Mi ± 0%       ~ (p=0.773 n=20)
LintRW/sqlserver     1.971Mi ± 0%     1.971Mi ± 0%       ~ (p=0.497 n=20)
LintRW/oracle        2.435Mi ± 0%     2.435Mi ± 0%       ~ (p=0.014 n=20)
LintRW/sqlite        2.173Mi ± 0%     2.173Mi ± 0%       ~ (p=0.167 n=20)
LintRW/snowflake     2.172Mi ± 0%     2.172Mi ± 0%       ~ (p=0.244 n=20)
LintRW/clickhouse    2.440Mi ± 0%     2.440Mi ± 0%       ~ (p=0.867 n=20)
LintRule/L007        92.98Ki ± 0%     92.98Ki ± 0%       ~ (p=1.000 n=20) ¹
LintRule/L010          0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                           ²                 +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                   │     base      │                 head                 │
                   │   allocs/op   │  allocs/op   vs base                 │
LintParallel/rules   68.93k ± 0%     68.93k ± 0%       ~ (p=0.942 n=20)
LintParallel/lint    126.7k ± 0%     126.7k ± 0%       ~ (p=0.997 n=20)
LintRW/postgresql    14.13k ± 0%     14.13k ± 0%       ~ (p=1.000 n=20) ¹
LintRW/mysql         17.46k ± 0%     17.46k ± 0%       ~ (p=1.000 n=20) ¹
LintRW/mariadb       15.76k ± 0%     15.76k ± 0%       ~ (p=1.000 n=20) ¹
LintRW/sqlserver     13.87k ± 0%     13.87k ± 0%       ~ (p=1.000 n=20)
LintRW/oracle        16.86k ± 0%     16.86k ± 0%       ~ (p=0.320 n=20)
LintRW/sqlite        15.74k ± 0%     15.74k ± 0%       ~ (p=1.000 n=20)
LintRW/snowflake     15.20k ± 0%     15.20k ± 0%       ~ (p=1.000 n=20)
LintRW/clickhouse    17.66k ± 0%     17.66k ± 0%       ~ (p=1.000 n=20) ¹
LintRule/L007        1.194k ± 0%     1.194k ± 0%       ~ (p=1.000 n=20) ¹
LintRule/L010         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                          ²                +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                  │    base     │                head                │
                  │  sec/stmt   │  sec/stmt    vs base               │
LintRW/postgresql   10.95µ ± 0%   10.93µ ± 0%       ~ (p=0.578 n=20)
LintRW/mysql        9.175µ ± 0%   9.185µ ± 0%       ~ (p=0.490 n=20)
LintRW/mariadb      9.174µ ± 1%   9.157µ ± 1%       ~ (p=0.344 n=20)
LintRW/sqlserver    11.90µ ± 2%   11.94µ ± 2%       ~ (p=0.703 n=20)
LintRW/oracle       10.80µ ± 2%   10.76µ ± 1%       ~ (p=0.738 n=20)
LintRW/sqlite       9.286µ ± 1%   9.252µ ± 1%       ~ (p=0.449 n=20)
LintRW/snowflake    10.19µ ± 1%   10.18µ ± 1%       ~ (p=0.644 n=20)
LintRW/clickhouse   9.461µ ± 1%   9.469µ ± 1%       ~ (p=0.693 n=20)
LintRule/L007       782.6n ± 2%   791.2n ± 2%       ~ (p=0.410 n=20)
LintRule/L010       244.9n ± 5%   233.6n ± 9%       ~ (p=0.292 n=20)
geomean             5.380µ        5.357µ       -0.42%

pkg: github.com/ajitpratap0/GoSQLX/pkg/sql/keywords
                         │    base     │                head                │
                         │   sec/op    │   sec/op     vs base               │
DetectDialect/empty        1.307n ± 1%   1.307n ± 2%       ~ (p=0.784 n=20)
DetectDialect/generic      274.5n ± 1%   274.4n ± 2%       ~ (p=0.465 n=20)
DetectDialect/postgresql   341.8n ± 5%   341.4n ± 5%       ~ (p=0.867 n=20)
DetectDialect/mysql        310.8n ± 8%   305.9n ± 6%       ~ (p=0.387 n=20)
DetectDialect/sqlserver    353.4n ± 5%   352.0n ± 5%       ~ (p=0.180 n=20)
DetectDialect/oracle       320.1n ± 3%   318.4n ± 3%       ~ (p=0.380 n=20)
DetectDialect/snowflake    425.5n ± 1%   424.7n ± 1%       ~ (p=0.245 n=20)
DetectDialect/mariadb      248.5n ± 5%   247.5n ± 5%       ~ (p=0.286 n=20)
DetectDialect/mixed        368.1n ± 1%   367.4n ± 1%       ~ (p=0.578 n=20)
DetectDialect/large_64KB   421.3µ ± 2%   421.2µ ± 2%       ~ (p=0.758 n=20)
geomean                    384.5n        383.2n       -0.34%

                         │     base     │                head                 │
                         │     B/s      │     B/s       vs base               │
DetectDialect/generic      184.1Mi ± 1%   184.2Mi ± 2%       ~ (p=0.449 n=20)
DetectDialect/postgresql   187.0Mi ± 6%   187.1Mi ± 5%       ~ (p=0.883 n=20)
DetectDialect/mysql        178.0Mi ± 8%   180.8Mi ± 6%       ~ (p=0.394 n=20)
DetectDialect/sqlserver    175.4Mi ± 5%   176.1Mi ± 5%       ~ (p=0.192 n=20)
DetectDialect/oracle       181.8Mi ± 3%   182.7Mi ± 3%       ~ (p=0.387 n=20)
DetectDialect/snowflake    199.5Mi ± 1%   199.9Mi ± 1%       ~ (p=0.239 n=20)
DetectDialect/mariadb      180.4Mi ± 5%   181.2Mi ± 5%       ~ (p=0.304 n=20)
DetectDialect/mixed        191.7Mi ± 1%   192.1Mi ± 1%       ~ (p=0.583 n=20)
DetectDialect/large_64KB   148.5Mi ± 2%   148.6Mi ± 2%       ~ (p=0.763 n=20)
geomean                    180.2Mi        180.9Mi       +0.38%

                         │     base     │                head                 │
                         │     B/op     │    B/op     vs base                 │
DetectDialect/empty        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/generic      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/postgresql   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mysql        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/sqlserver    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/oracle       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/snowflake    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mariadb      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mixed        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/large_64KB   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                         │     base     │                head                 │
                         │  allocs/op   │ allocs/op   vs base                 │
DetectDialect/empty        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/generic      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/postgresql   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mysql        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/sqlserver    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/oracle       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/snowflake    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mariadb      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/mixed        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
DetectDialect/large_64KB   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/ajitpratap0/GoSQLX/pkg/sql/tokenizer
                         │    base     │                head                │
                         │   sec/op    │   sec/op     vs base               │
Tokenize/scratch/join      1.036µ ± 3%   1.027µ ± 1%       ~ (p=0.256 n=20)
Tokenize/scratch/complex   2.744µ ± 2%   2.683µ ± 4%       ~ (p=0.176 n=20)
Tokenize/scratch/insert    535.8n ± 2%   526.1n ± 2%       ~ (p=0.214 n=20)
geomean                    1.150µ        1.132µ       -1.64%

                         │     base     │                head                 │
                         │     B/s      │     B/s       vs base               │
Tokenize/scratch/join      116.0Mi ± 3%   117.1Mi ± 1%       ~ (p=0.242 n=20)
Tokenize/scratch/complex   131.4Mi ± 2%   134.4Mi ± 4%       ~ (p=0.180 n=20)
Tokenize/scratch/insert    135.3Mi ± 2%   137.8Mi ± 2%       ~ (p=0.214 n=20)
geomean                    127.3Mi        129.4Mi       +1.68%

                         │     base     │                head                 │
                         │     B/op     │    B/op     vs base                 │
Tokenize/scratch/join      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
Tokenize/scratch/complex   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
Tokenize/scratch/insert    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                         │     base     │                head                 │
                         │  allocs/op   │ allocs/op   vs base                 │
Tokenize/scratch/join      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
Tokenize/scratch/complex   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
Tokenize/scratch/insert    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/ajitpratap0/GoSQLX/pkg/transform
                             │    base     │                head                │
                             │   sec/op    │   sec/op     vs base               │
TransformParse/simple_select   818.3n ± 0%   818.9n ± 1%       ~ (p=0.733 n=20)
TransformParse/join            3.280µ ± 1%   3.301µ ± 1%       ~ (p=0.223 n=20)
TransformParse/complex         8.831µ ± 1%   8.822µ ± 1%       ~ (p=0.947 n=20)
geomean                        2.872µ        2.878µ       +0.20%

                             │     base     │                 head                  │
                             │     B/op     │     B/op      vs base                 │
TransformParse/simple_select     704.0 ± 0%     704.0 ± 0%       ~ (p=1.000 n=20) ¹
TransformParse/join            1.789Ki ± 0%   1.789Ki ± 0%       ~ (p=1.000 n=20) ¹
TransformParse/complex         4.883Ki ± 0%   4.883Ki ± 0%       ~ (p=1.000 n=20) ¹
geomean                        1.818Ki        1.818Ki       +0.00%
¹ all samples are equal

                             │    base    │                head                 │
                             │ allocs/op  │ allocs/op   vs base                 │
TransformParse/simple_select   3.000 ± 0%   3.000 ± 0%       ~ (p=1.000 n=20) ¹
TransformParse/join            15.00 ± 0%   15.00 ± 0%       ~ (p=1.000 n=20) ¹
TransformParse/complex         43.00 ± 0%   43.00 ± 0%       ~ (p=1.000 n=20) ¹
geomean                        12.46        12.46       +0.00%
¹ all samples are equal

Run, raw data and benchstat

Test and others added 2 commits November 3, 2026 23:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
…and comment fixes [W1-04]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 19s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the diff for stackgrow.go, the tokscratch and parser call sites, the CHANGELOG and gate-suite.txt. I did not build or run tests. Test results below come from the PR description and the perf-gate comment.

Verdict: no blocking issues. The change is small, internal-only, and the amd64 gate confirms it.

Evidence

  • The amd64 layout-randomized gate passes. ParseFresh/simple_select is -58.7%, join -43.6% and complex -23.5%. allocs/op and B/op are unchanged.
  • The A/A' control is clean: 0 of 52 benchmarks moved more than 3%.
  • ParseE2E/delete is +1.63% (p=0.001, flagged "ok"). The call is about 1 ns, and that benchmark takes about 1.2 µs on a warm goroutine. That is roughly the size of the delta, so it is consistent with the cost of Reserve on the already-grown path. It is not a regression, but it is the one place the cost shows up.
  • Instructions/op rise by 0.05-0.40%, well under the 1.5% bound.

Code

  • internal/stackgrow/stackgrow.go
    • The approach is sound. The 12 KiB frame sits behind a never-true package-level guard, so the prologue forces morestack and the array is never zeroed.
    • //go:noinline on both functions is correct, and passing &buf to a noinline callee keeps the frame in place.
    • The cost of this design is that it depends on never not being constant-folded. Your mutation check (never as const fails T1) covers that.
  • Call sites
    • tokscratch.Bytes/String/StringContext plus the four public pipelines and three parser-core backstops give good coverage. Your corpus check reports 2996 of 2999 statements.
    • The parser backstop comments are accurate but long. They sit on one line and repeat verbatim at parseTokens and parseContextTokens. Consider a shared doc comment on stackgrow.Reserve and a short // backstop; see stackgrow at the call sites.

Non-blocking suggestions

  1. Gate suite widening (M2).
    • The diff shows gate-suite.txt already includes insert|update|delete for ParseFresh. That contradicts the PR body, which says the suite was not widened. Please update the PR body or revert the line, whichever you intended.
    • The gate ran on head 58e1cfa, and its table has no ParseFresh/insert, update or delete rows. The suite change landed after that run (it looks like it came with the later commit 21e8482), so the new cells have not been gated yet. I recommend keeping them and checking the next gate run.
  2. CHANGELOG. The entry says "insert, update, delete: see the PR". That leaves the numbers outside the repo. Fill them in from the next gate run or drop the parenthetical. The same entry also repeats the memory trade-off that appears under "Behavior changes", so you could shorten one of the two.
  3. Toolchain fragility. The landing size (16 KiB) depends on the runtime's stack-growth policy. Check that T2 and T4 failure messages point at the package doc comment, so a Go upgrade failure is diagnosable.
  4. Memory. Short-lived goroutines that parse once now hold at least 16 KiB. The CHANGELOG records this. A line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  5. Test flakes. The wall-clock ratio flakes in your task check run came from machine load, not this change. Please confirm a clean CI test:race run before merge.

Security

No new input handling, no unsafe, and the reserved size is a compile-time constant. No concerns.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), a corpus coverage check, budget tests, and the mutation checks listed in the PR.

Overall this is good to merge once the CHANGELOG numbers and the PR-body/gate-suite.txt mismatch are resolved.

… [W1-04]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 21s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read stackgrow.go, the CHANGELOG, test.yml and gate-suite.txt diffs. I did not build or run tests.

Verdict: no blocking issues. The change is small and internal-only. The latest amd64 gate run confirms the gain.

Evidence

  • ParseFresh: simple_select -58.6%, join -43.7%, complex -23.8%, and insert/update/delete -57% to -66%. allocs/op and B/op are unchanged. The A/A' control is clean (0 of 55 benchmarks moved more than 3%).
  • Instructions/op: +0.06% to +0.45%, under the 1.5% bound.
  • ParseRW/clickhouse/medium is flagged slower (+3.22%, p<0.001).
    • ParseRW/sqlite/medium is +1.86% (p=0.001) and not flagged.
    • The ParseRW benchmarks measure the warm path, where Reserve is a no-op after the first call. A 3% slowdown on a roughly 90 µs benchmark is about 3 µs, far more than a 1 ns call.
    • The A/A' control for clickhouse moved +2.18%, and its spread is 3.49%, so layout noise is the likely cause.
    • The gate is in shadow mode. Re-run once and confirm it is not reproducible before merge.

Code

  • stackgrow.go is sound. The frame is above the big-frame threshold, the guard never is a package variable so it can't be folded, and //go:noinline is on both functions. The array is never zeroed. The mutation checks in the PR body cover the const-folding case.
  • Toolchain fragility: the 16 KiB landing depends on runtime stack-growth policy. Make sure the T2 and T4 failure messages point at the package doc comment, so a Go upgrade failure is easy to diagnose.
  • Comments at call sites: the parser backstop comments repeat across parseTokens and parseContextTokens. A short // backstop; see stackgrow would do, with the detail kept on Reserve.

Items to resolve before merge

  1. PR body vs gate-suite.txt. The diff widens BenchmarkParseFresh to simple_select|join|complex|insert|update|delete. The PR body says the suite was not widened (decision M2). Update the body, or revert the line. The latest gate run does show the insert/update/delete rows, so I'd keep the change and fix the body.
  2. CHANGELOG now has the real numbers for insert, update and delete. The memory trade-off appears in both the Performance entry and the Behavior changes entry. You could shorten one of them.
  3. .github/workflows/test.yml (CI step):
    • The diff shows the step running -run 'AllocBudget|StackBudget|StackReserve' ./pkg/gosqlx only.
    • The PR body says the step also covers ./internal/stackgrow.
    • Either add the package to the step, or fix the body. The stackgrow tests would otherwise only run in the general test job.
  4. Memory docs. Short-lived goroutines that parse once now hold at least 16 KiB. A note in docs/PERFORMANCE_METHODOLOGY.md or the user docs would help server users find this. It is recorded in the CHANGELOG.
  5. Race run. Confirm a clean CI test:race run. The flakes in the PR body came from machine load and are unrelated to this change.

Security

No new input handling, no unsafe, and the reserved size is a compile-time constant. No concerns.

Test coverage

Good. It covers entry-point enumeration (NoUnreserved), the corpus coverage check (2996 of 2999), the budget tests and the mutation checks.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 28s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main. I did not build or run tests. Test and perf numbers come from the PR body and the gate comment.

Verdict: no blocking issues. The earlier review notes about the CHANGELOG placeholder and the gate-suite.txt mismatch are resolved in the current head.

Resolved since the earlier reviews

  • The CHANGELOG now carries real amd64 gate numbers for all six ParseFresh cells, with no "see the PR" placeholder.
  • scripts/perf/gate-suite.txt includes insert|update|delete, and the PR body now says so. The latest gate run shows those cells at -57%, -59% and -66%.
  • The memory trade-off is documented under "Behavior changes".

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array sits behind a never-written package variable, so it is never zeroed, and the two //go:noinline markers keep the frame.
    • The cost is a call and a compare, about 1 ns when the stack is already large.
    • The package is internal, so no API surface changes.
  • Call sites are consistent: the tokscratch entry points, the four public pipelines and the three parser-core backstops.
  • Pooling and concurrency: nothing here touches pooled objects, so the CLAUDE.md pooling and race rules are unaffected.

Non-blocking suggestions

  1. Duplicated comment. The ~250-character one-line comment is repeated verbatim in parseTokens and parseContextTokens (pkg/sql/parser/parser.go). It also has nested parentheses. Put the caveat in the Reserve doc comment and use // backstop; see stackgrow.Reserve at the call sites. parseWithRecovery and ParseBytesWithTokens have no comment, so they would benefit too.
  2. Entry-reserve sites. Analyze, LintString, parseWithRecoveryForDialect and ParseBytesWithTokens call Reserve and then reach tokscratch or the parser core, which call it again. That is intentional and costs about 1 ns. A short note such as // entry reserve; tokscratch and parser core also backstop would stop a later cleanup from removing the "redundant" call. The NoUnreserved test probably catches that, but the note is cheaper.
  3. Toolchain fragility. The 16 KiB landing depends on the runtime's stack growth policy. The package doc covers Windows and -race. Make sure the T2 and T4 failure messages point at that doc, so a future Go upgrade is easy to diagnose.
  4. Server memory note. A goroutine-per-request server that parses once now holds at least 16 KiB per goroutine. A line in docs/PERFORMANCE_METHODOLOGY.md or the user docs would help those users find it. Worker pools see no change.
  5. CI scope. The non-race step runs -run 'AllocBudget|StackBudget|StackReserve' ./pkg/gosqlx. The PR body says ./pkg/gosqlx ./internal/stackgrow. The diff in .github/workflows/test.yml only lists ./pkg/gosqlx, so the internal/stackgrow tests do not run in that step. They still run in the normal go test ./... job. Add ./internal/stackgrow to the step if the intent is to run them without -race, or update the PR body.
  6. Open perf items, as the PR body already says.
    • ParseFresh/complex reaches -23.3%, below the W1-04 target of -40%. Re-check the W3-06 trigger against this result.
    • ParseRW/clickhouse/medium was flagged at +3.2% in one run (A/A' +2.2%, Low-power list). It did not reproduce in the other run. It is worth a look if it shows up again.
    • The LintRW/postgresql allocs/op change (+1 in 34k) is pool jitter.

Security

No new input handling, no unsafe, and the reserved size is a compile-time constant. No concerns.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), a real-world corpus coverage check (2996/2999), the stack budget tests and the mutation checks. Confirm a clean CI task test:race run before merge, because the timing-ratio flakes you saw locally came from machine load.

Overall this looks good to merge once CI is green.

…omments [W1-04]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
… [W1-04]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 21s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main. I did not build or run tests. Test and perf numbers come from the PR body and the gate comment.

Verdict: no blocking issues. The change is small and internal-only, and the amd64 gate confirms the gain.

Evidence

  • Gate result: the latest gate run is PASS. ParseFresh is faster in all six cells: simple_select -60.2%, join -39.7%, complex -22.7%, insert -57.2%, update -60.0%, delete -67.1%. Suite geomean is -7.99%.
  • Unchanged metrics: allocs/op and B/op are unchanged. Instructions/op rise by at most +0.28%. The A/A' control moved 0 of 55 benchmarks.
  • Join target: the PR body cites join at -43%. The latest run measured -39.7%, just short of the W1-04 -40% target. The CHANGELOG already says so ("borderline"), so the PR body should say the same.
  • Complex target: complex misses the -40% target (-22.7% to -23.5%), as the PR body already reports. Re-check the W3-06 trigger against it.

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array is behind a never-written package variable, so the compiler keeps the frame and the array is never zeroed.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no API surface changes.
  • Call sites: tokscratch.Bytes/String/StringContext, ParseBytesWithTokens, and the three parser-core backstops (parseTokens, parseContextTokens, parseWithRecovery). These are consistent. Nothing touches pooled objects, so the CLAUDE.md pooling and race rules are unaffected.
  • Comments: the parser backstop comments are now short and fine. parseWithRecovery and ParseBytesWithTokens have none. Add a one-line // entry reserve; tokscratch and parser core also reserve at the entry-reserve sites (Analyze, LintString, LSP parseWithRecoveryForDialect, ParseBytesWithTokens). It keeps a later cleanup from removing the "redundant" call.

Items to resolve

  1. CI step scope. .github/workflows/test.yml runs -run 'AllocBudget|StackBudget|StackReserve' ./pkg/gosqlx only. The PR body says ./pkg/gosqlx ./internal/stackgrow. Either add ./internal/stackgrow to the step or fix the body. The stackgrow tests still run in the normal test job. I cannot edit workflow files from this job.
  2. PR body vs CHANGELOG. The join figure differs (see Evidence). Align the PR body with the latest run.
  3. Toolchain fragility. The 16 KiB landing depends on the runtime's stack-growth policy. The package doc covers Windows and -race. Make sure the T2 and T4 failure messages point to that doc, so a Go upgrade failure is diagnosable.
  4. Server memory note. A goroutine-per-request server that parses once now holds at least 16 KiB per goroutine. The CHANGELOG records this under "Behavior changes". A line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it. Worker pools see no change.
  5. Race run. Confirm a clean CI task test:race run. The timing-ratio flakes in the PR body came from machine load, not from this change.

Security

No new input handling, no unsafe, and the reserved size is a compile-time constant. No concerns.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), a real-world corpus coverage check (2996/2999), the stack budget tests and the mutation checks.

Overall this is good to merge once CI is green and the CI step scope is settled.

…ved [W1-04]

A GC cycle can shrink the goroutine stack mid-parse (seen on windows-latest),
which the test misread as a growth copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 19s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main. I did not build or run tests. Test and perf numbers come from the PR body and the gate comment.

Verdict: no blocking issues. The change is small and internal-only, and the amd64 gate confirms the gain.

Evidence

  • Latest gate on 996ce7b: PASS. ParseFresh is faster in all six cells: simple_select -58.1%, join -43.9%, complex -26.1%, insert -56.0%, update -58.4%, delete -65.3%. Suite geomean is -7.56%.
  • Unchanged metrics: allocs/op and B/op are unchanged. Instructions/op rise by at most +0.39%, under the 1.5% bound. The A/A' control moved 0 of 55 benchmarks.
  • Gate on the current head: this run covers the merge that keeps the stack reservation in the pooled LintString. The PR-body note "gate run on bc76d08 pending" is resolved by it. The LintRW and LintParallel cells are within noise (≤ ±1.1%).
  • PR body vs CHANGELOG: the PR body still quotes join at -43%, and the CHANGELOG says "borderline, -39.7% in the latest". The two latest gate runs gave -39.7% and -43.9%, so join sits right at the -40% target and varies by runner. Tell readers it is noise-limited around the target, not clearly missed or met.
  • Complex target: complex reaches -23% to -26% against the -40% target. The PR body already says so. Re-check the W3-06 trigger against this result.

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array sits behind a never-written package variable, so it is never zeroed, and //go:noinline on Reserve and sink keeps the frame.
    • The cost is a call and a compare, about 1 ns.
    • The package is internal, so no API surface changes.
  • Pooling and concurrency: nothing here touches pooled objects, so the CLAUDE.md pooling and race rules are unaffected.
  • LintString placement: the Reserve call comes before the pooled tokenizer and parser are taken, so it cannot affect their lifetime.
  • Call-site comments:
    • parseTokens and parseContextTokens carry the same "Reserve is a no-op after an earlier reservation" comment, which is fine.
    • parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect have none.
    • Add a one-line note at those sites, such as // entry reserve; tokscratch and the parser core also reserve. It keeps a later cleanup from removing the "redundant" call.

Items to resolve

  1. CI step scope. .github/workflows/test.yml runs -run 'AllocBudget|StackBudget|StackReserve' ./pkg/gosqlx only. The PR body says the step also covers ./internal/stackgrow. The body's other explanation, that task test:race runs it, holds for TestReserveAvoidsLaterCopies. Fix the wording so it says the non-race step covers ./pkg/gosqlx only. I cannot edit workflow files from this job.
  2. Toolchain fragility. The 16 KiB landing depends on the runtime's stack-growth policy. The package doc covers Windows and -race. Make sure the T2 and T4 failure messages point at that doc, so a Go upgrade failure is diagnosable.
  3. Server memory note. A goroutine-per-request server that parses once now holds at least 16 KiB per goroutine. The CHANGELOG records this under "Behavior changes". A line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it. Worker pools see no change.
  4. Race run. Confirm a clean CI test:race run. The timing-ratio flakes in the PR body came from machine load, not from this change.

Security

No new input handling, no unsafe, and the reserved size is a compile-time constant. No concerns.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), a real-world corpus coverage check (2996/2999), the stack budget tests and the mutation checks.

Overall this is good to merge once CI is green and the CI step wording is settled.
· branch perf/w1-04-stack-pregrow

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 21s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main. I did not build or run tests. Test and perf numbers come from the PR body and the gate comments.

Verdict: no blocking issues. The change is small and internal-only. The amd64 gate shows the gain, with allocs/op and B/op unchanged.

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array sits behind a never-written package variable, so the frame stays and the array is never zeroed.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no API surface changes.
  • Call sites are consistent: tokscratch.Bytes/String/StringContext, ParseBytesWithTokens, Analyze, LintString, LSP parseWithRecoveryForDialect, and the parser backstops (parseTokens, parseContextTokens, parseWithRecovery).
  • Pooling: every Reserve call comes before pooled objects are taken, so the pooling and race rules in CLAUDE.md are unaffected.
  • Security: no new input handling and no unsafe. The reserved size is a compile-time constant.

Items to resolve

  1. CI step scope. .github/workflows/test.yml runs AllocBudget|StackBudget|StackReserve on ./pkg/gosqlx only. The PR body says the step also covers ./internal/stackgrow. Reword the body: ./internal/stackgrow runs under task test:race, not in the non-race step. I cannot edit workflow files from this job.
  2. Join figure in the PR body. The body quotes join at about -43%. The CHANGELOG says "borderline", and the runs gave -39.7% and -43.9%. The PR body already says the target is "noise-limited", so this is only a wording check.
  3. Entry-site comments. parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect have no comment on their Reserve call. A short note such as // entry reserve; tokscratch and parser core also reserve would keep a later cleanup from removing the "redundant" call.
  4. Toolchain fragility. The 16 KiB landing depends on the Go runtime's stack-growth policy. Make sure the T2 and T4 failure messages point at the stackgrow package doc, so a Go upgrade failure is easy to diagnose.
  5. Server memory note. A goroutine-per-request server that parses once now keeps at least 16 KiB per goroutine. The CHANGELOG records this. A line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  6. Open perf items, as the PR body already says:
    • ParseFresh/complex reaches -23% to -26% against the -40% target. Re-check the W3-06 trigger.
    • The PoolGetPut/serial +4.78% result in the shadow gate run is worth a look. That benchmark never calls Reserve, so layout noise is the likely cause, but check that it does not reproduce.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), the real-world corpus check (2996/2999), the stack budget tests and the mutation checks. Confirm a clean CI task test:race run before merge, because the timing-ratio flakes you saw locally came from machine load.

Overall this is good to merge once CI is green and the CI step wording is settled.
· branch perf/w1-04-stack-pregrow

Test and others added 2 commits November 12, 2026 14:18
…atch doc [W1-04]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 20s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main. I did not build or run tests. The test and perf numbers come from the PR body and the gate comments.

Verdict: no blocking correctness issues. The change is small and internal-only. The amd64 gate shows large ParseFresh gains, with allocs/op and B/op unchanged. One gate result still needs a maintainer decision (below).

Code

  • internal/stackgrow/stackgrow.go
    • The 12 KiB array sits behind a never-written package variable, so the frame is kept and the array is never zeroed.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no API surface changes.
  • Call sites
    • Every Reserve call comes before any pooled object is taken. The pooling and race rules in CLAUDE.md are unaffected.
    • Coverage of the entry points looks complete: tokscratch.*, ParseBytesWithTokens, Analyze, LintString, LSP parseWithRecoveryForDialect, and the parser backstops.
  • Security: no new input handling and no unsafe. The reserved size is a compile-time constant.

Items to resolve

  1. PoolGetPut/serial +4.78% (run 5).
    • It reproduced on re-run.
    • The CLAUDE.md rule allows no gated time regression.
    • The latest gate on head a70d80d shows PoolGetPut/serial at -0.21%, so run 5 looks like Intel-runner or data-layout noise. Please state that in the PR body, or confirm with one more Intel run.
    • The ast.poolLeakCount offset hypothesis is unproven. If the regression returns, consider padding or aligning that counter.
  2. CI step wording.
    • .github/workflows/test.yml runs AllocBudget|StackBudget|StackReserve on ./pkg/gosqlx only.
    • The PR body says the step covers ./internal/stackgrow too.
    • Either add the package to the step, or reword the body. internal/stackgrow already runs under task test:race.
    • I can't edit workflow files from this job.
  3. Entry-site comments.
    • parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect have no comment on their Reserve call.
    • A one-liner such as // entry reserve; tokscratch and parser core also reserve would stop a later cleanup from removing the "redundant" call.
  4. Toolchain fragility.
    • The 16 KiB landing depends on the runtime's stack-growth policy.
    • Make sure the T2 and T4 failure messages point at the stackgrow package doc, so a Go upgrade failure is easy to diagnose.
  5. Server memory note.
    • A goroutine-per-request server that parses once now keeps at least 16 KiB per goroutine.
    • The CHANGELOG records this. One line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  6. W1-04 target.
    • ParseFresh/complex reaches -23% to -26% against the -40% target.
    • join is noise-limited around -40% (-39.7% to -43.9%).
    • The PR body already reports both. Re-check the W3-06 trigger against them.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), the real-world corpus check (2996/2999), stack budget tests and the mutation checks. Confirm a clean CI task test:race run before merge, because the timing-ratio flakes you saw locally came from machine load.
· branch perf/w1-04-stack-pregrow

#961 replaced direct CHANGELOG.md edits with per-PR changelog.d/
fragments, which removes this PR's CHANGELOG.md merge conflicts. The
entry text is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 22s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read stackgrow.go and the test.yml diff. I did not build or run tests. The perf numbers come from the PR body and the gate comments.

Verdict: no blocking issues. The change is small and internal-only. The gate shows large ParseFresh gains with allocs/op and B/op unchanged.

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array sits behind a never-written package variable, so the frame stays and the array is never zeroed.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no public API changes.
  • Call sites: each Reserve call comes before any pooled object is taken. The pooling and race rules in CLAUDE.md are unaffected.
  • Security: there is no new input handling and no unsafe. The reserved size is a compile-time constant.

Items to resolve

  1. PoolGetPut/serial +4.78% (run 5).
    • It reproduced on re-run on Intel Xeon 8573C.
    • Run 6 on EPYC shows -0.21% (p=0.665).
    • PoolGetPut never calls Reserve, so layout noise is plausible. The ast.poolLeakCount offset explanation is still unproven.
    • The CLAUDE.md rule allows no gated time regression. Settle this by confirming with one more Intel run, or by an explicit maintainer waiver recorded in the PR.
  2. CI step wording. test.yml runs AllocBudget|StackBudget|StackReserve on ./pkg/gosqlx only. The PR body says the step also covers ./internal/stackgrow. Reword the body, since internal/stackgrow runs under task test:race. Alternatively, add it to the step. I can't edit workflow files from this job.
  3. Entry-site comments. The Reserve calls in parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect carry no comment. Add a one-liner such as // entry reserve; tokscratch and parser core also reserve so a later cleanup doesn't remove the "redundant" call.
  4. Toolchain fragility. The 16 KiB landing depends on the runtime's stack-growth policy. Make sure the T2 and T4 failure messages point at the stackgrow package doc, so a Go upgrade failure is easy to diagnose.
  5. Server memory note. A goroutine-per-request server that parses once now keeps at least 16 KiB per goroutine. The CHANGELOG records this. One line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  6. W1-04 target.
    • ParseFresh/complex reaches -23% to -26% against the -40% target.
    • join is noise-limited around -40% (-39.7% to -43.9%).
    • The PR body reports both. Re-check the W3-06 trigger against them.

Test coverage

Coverage is good. It includes entry-point enumeration (NoUnreserved), the real-world corpus check (2996/2999), the stack budget tests and the mutation checks. Confirm a clean CI task test:race run, because the timing-ratio flakes you saw locally came from machine load.
· branch perf/w1-04-stack-pregrow

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 21s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the full diff against origin/main, including stackgrow.go, the call sites, test.yml and gate-suite.txt. I did not build or run tests. The perf numbers come from the PR body and the gate comments.

Verdict: no blocking correctness issues. The change is small and internal-only. The amd64 gate shows large ParseFresh gains, with allocs/op and B/op unchanged. One gate result needs a maintainer decision (item 1).

Code

  • internal/stackgrow/stackgrow.go is sound.
    • The 12 KiB array sits behind a never-written package variable, so the compiler keeps the frame and the array is never zeroed.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no public API changes.
  • Call sites are consistent: tokscratch.Bytes/String/StringContext, ParseBytesWithTokens, Analyze, LintString, LSP parseWithRecoveryForDialect, and the parser backstops (parseTokens, parseContextTokens, parseWithRecovery). Every Reserve runs before any pooled object is taken, so the CLAUDE.md pooling and race rules are unaffected.
  • Security: no new input handling and no unsafe. The reserved size is a compile-time constant.

Items to resolve

  1. PoolGetPut/serial +4.78% (run 5).
    • It reproduced on re-run on Intel Xeon 8573C. Run 6 on EPYC shows -0.21% (p=0.665).
    • PoolGetPut never calls Reserve, so layout or data-alignment noise is plausible. The ast.poolLeakCount offset explanation is still unproven.
    • CLAUDE.md allows no gated time regression. Either confirm with one more Intel run, or record an explicit maintainer waiver in the PR.
  2. CI step wording. .github/workflows/test.yml runs AllocBudget|StackBudget|StackReserve on ./pkg/gosqlx only. The PR body says the step also covers ./internal/stackgrow. Reword the body, because internal/stackgrow runs under task test:race. I can't edit workflow files from this job.
  3. Entry-site comments. parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect have no comment on their Reserve call. A one-liner such as // entry reserve; tokscratch and parser core also reserve would stop a later cleanup from removing the "redundant" call.
  4. Toolchain fragility. The 16 KiB landing depends on the runtime's stack-growth policy. Make sure the T2 and T4 failure messages point at the stackgrow package doc, so a Go upgrade failure is easy to diagnose.
  5. Server memory note. A goroutine-per-request server that parses once now keeps at least 16 KiB per goroutine. The changelog fragment records this. One line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  6. W1-04 target. ParseFresh/complex reaches -23% to -26% against the -40% target. join is noise-limited around -40% (-39.7% to -43.9%). The PR body reports both. Re-check the W3-06 trigger against them.

Test coverage

Good. It includes entry-point enumeration (NoUnreserved), the real-world corpus check (2996/2999), the stack budget tests and the mutation checks. Confirm a clean CI task test:race run, because the timing-ratio flakes you saw locally came from machine load.
· branch perf/w1-04-stack-pregrow

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Claude finished @ajitpratap0's task in 16s —— View job


Review of PR #940: reserve the parse stack once before tokenizing [W1-04]

I read the diff against origin/main. I did not build or run tests. The perf and test numbers come from the PR body and the gate comments.

Verdict: no blocking correctness issues. The change is small and internal-only. The amd64 gate shows large ParseFresh gains (-24% to -66%) with allocs/op and B/op unchanged. One earlier gate flag still needs a recorded maintainer decision (item 1).

Code

  • internal/stackgrow/stackgrow.go
    • The 12 KiB array sits behind a never-written package variable, so the compiler keeps the frame but never zeroes the array.
    • //go:noinline on Reserve and sink keeps the frame in place.
    • The package is internal, so no public API changes.
  • Call sites
    • Every Reserve runs before any pooled object is taken. The pooling and race rules in CLAUDE.md are unaffected.
    • The entry points are covered: tokscratch.*, ParseBytesWithTokens, Analyze, LintString, LSP parseWithRecoveryForDialect, and the parser backstops.
  • Security: no new input handling and no unsafe. The reserved size is a compile-time constant.

Items to resolve

  1. PoolGetPut/serial +4.78% (run 5, Intel Xeon 8573C).
    • It reproduced on re-run. Runs 6 and 7 on EPYC show -0.21% and -0.31%.
    • PoolGetPut never calls Reserve. The ast.poolLeakCount alignment hypothesis is unproven.
    • CLAUDE.md allows no gated time regression. Either confirm with one more Intel run, or record an explicit maintainer waiver in the PR body.
  2. CI step wording.
    • .github/workflows/test.yml runs AllocBudget|StackBudget|StackReserve on ./pkg/gosqlx only.
    • The PR body says the step also covers ./internal/stackgrow. Reword the body, because internal/stackgrow runs under task test:race. I can't edit workflow files from this job.
  3. Entry-site comments.
    • The Reserve calls in parseWithRecovery, ParseBytesWithTokens, Analyze, LintString and LSP parseWithRecoveryForDialect have no comment.
    • Add a one-liner such as // entry reserve; tokscratch and parser core also reserve, so a later cleanup doesn't remove the "redundant" call.
  4. Toolchain fragility. The 16 KiB landing depends on the runtime's stack-growth policy. Make sure the T2 and T4 failure messages point at the stackgrow package doc, so a Go upgrade failure is easy to diagnose.
  5. Server memory note. A goroutine-per-request server that parses once now keeps at least 16 KiB per goroutine. The changelog fragment records this. One line in docs/PERFORMANCE_METHODOLOGY.md would help server users find it.
  6. W1-04 target.
    • ParseFresh/complex reaches -23% to -26% against the -40% target.
    • join is noise-limited around -40% (-39.7% to -43.9%).
    • The PR body reports both. Re-check the W3-06 trigger against them.

Test coverage

Coverage is good. It includes entry-point enumeration (NoUnreserved), the real-world corpus check (2996/2999), stack budget tests and the mutation checks. Confirm a clean CI task test:race run, because the timing-ratio flakes in the PR body came from machine load.
· branch perf/w1-04-stack-pregrow

@ajitpratap0
ajitpratap0 merged commit f562e50 into main Nov 15, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd documentation Improvements or additions to documentation linter lsp parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant