Repository navigation
perf(tokenizer): zero-copy @param and @@var token values [W2-03] - #925
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task in 29s —— View job Review of PR #925: zero-copy
|
Perf gate: PASS (shadow mode: report only, this check never fails)Base
Rules: time regresses at >= +3% with p < 0.01 (Mann-Whitney U), or a suite geomean >= +1.5% (per-round 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%. An A/A control with more than 10% of benchmarks moving over 3% is noisy: re-run once, then inconclusive (neutral). Gated suite (GOGC=off, GOMAXPROCS=1)
A/A control: 0 of 32 benchmarks moved more than 3%. Instructions per operation (cmd/perfdriver)
Secondary metric: default GC, GOMAXPROCS=1 (informational)
Environmentbenchstat (primary metric) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
… errors [W2-03] Add @rıght join, @ınner join, @groupıng sets, @@rıght join and keyword-named params to the golden (regenerated on origin/main's tokenizer, HEAD passes). Golden errors now record code and position only. ValueIsSourceSlice checks that values alias the input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 22s —— View job Review of PR #925: zero-copy
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 29s —— View job Review of PR #925: zero-copy
|
|
Claude finished @ajitpratap0's task in 23s —— View job Review of PR #925: zero-copy
|
Summary
W2-03 (TOK-7):
@paramand SQL Server@@vartoken values are nowt.src[atStart:pos]slices instead of"@"+identToken.Valueconcatenations, and the name is scanned withscanIdentifierTaildirectly (no throwawayWord, no compound lookahead). Names thatreadIdentifiertreats specially (U&"escapes, single letter before a quote, compound-keyword starts like@group by, non-ASCII names) fall back to the previous path with the position restored, so output is identical. No API change; no golden diff.Test Plan
TestAtParam_Golden(new,testdata/at_param_golden.txt): 41 inputs x 9 dialects, types/values/quote/spans and error code+position. Now also pins the non-ASCII guard (@rıght join x,@ınner join x,@groupıng sets,@@rıght join x: the old path joins these into one Placeholder) and keyword-named params (@select, @From, @Where). The golden was regenerated on origin/main's tokenizer.go and passes on this branch, so any diff is a behaviour change.TestAtParam_ValueIsSourceSlicenow checks that values alias theTokenizeStringinput (unsafe.StringData range check).TestAtParam_NoPerTokenAlloc: fails before (71 allocs), passes after.task check,task test:cbinding,go test -count=1 ./pkg/compatibility/..., staticcheck on./pkg/sql/tokenizer: all pass.task bench:ab BASE=origin/main BENCH='./pkg/sql/tokenizer=^BenchmarkTokenizeRW$'(shared M4, indicative): sec/op geomean -0.28%, all cells ~ (no significant time change); allocs/op: sqlserver small 4 -> 0, medium 8 -> 0, large 162 -> 9 (-94%); mariadb small 2 -> 0, large -64%; mysql large -52%; snowflake large -67%; oracle large -31%; sqlite large -15%. B/op: sqlserver small 33 -> 1, medium 71 -> 7 (-90%). No regressions.cbbee20d, merge 907178d, base f03332f): PASS, no gated metric moved past its threshold; A/A control 0 of 32 moved >3%. geomean -0.18% (p=0.029).ParseRW/sqlserver/medium-0.69% (p<0.001), allocs/op 936 -> 928 (-allocs), B/op -0.07%.Normalize/simple_selectis now -0.62%, confirming the earlier +3.34% flag on run 41429649507 was code layout noise. Other target cells are flat on time: mysql -0.19%, mariadb +0.42%, snowflake +0.20% (none significant). All gated allocs/op unchanged or lower, B/op unchanged.Breaking Changes
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2