Repository navigation
perf(lsp): cheaper semanticTokens [W6-11] - #948
ajitpratap0 wants to merge 4 commits into
Conversation
…ared case folding [W6-11] 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 32s —— View job Review of PR #948: cheaper semanticTokens [W6-11]I read the diff for Overall: The change looks correct and well contained. I found no blocking issues. What I checked
Suggestions (non-blocking)
Security: I found no concerns. There is no unsafe code, and the pooled buffers are cleared of document references before reuse. Tests: Coverage is good: a byte-identical golden, an LSP reference test against the old encoder, a fold test and benchmarks. |
Perf gate: PASS (shadow mode: report only, this check never fails)Base Runner CPU:
Rules: each arm runs 20 randomized code layouts ( Gated suite (GOGC=off, GOMAXPROCS=1)
A/A' control (base revision, disjoint layout seeds): 0 of 52 benchmarks moved more than 3%; 0 would have been flagged by the time rule; suite geomean -0.15%, p 0.081. Low power4 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.000192). A slowdown below the last column usually goes unflagged there; instructions/op, allocs/op and the suite geomean still guard them.
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)
Secondary metric: default GC, GOMAXPROCS=1 (informational)
Environmentbenchstat (primary metric, samples pooled across layouts: informational, the verdict uses the per-layout test) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 25s —— View job Review of PR #948: cheaper semanticTokens [W6-11]I read the full diff of Verdict: The change is correct and well contained. I found one minor issue and a few nits. Minor issue: stale lexemes can pin memory in the pool
What I checked and found correct
Nits (non-blocking)
Security: No concerns. There is no unsafe code, and pooled buffers are cleared before reuse, apart from the retry edge case above. Tests: Coverage is good: a byte-identical golden, an LSP reference test, a fold test and benchmarks. |
…ing [W6-11] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 33s —— View job Review of PR #948: cheaper semanticTokens [W6-11]I read Verdict: I found no blocking issues. I checked the earlier "stale lexemes pin memory" concern from the previous review and it does not apply to the current code. Why the
Non-blocking suggestions
Security: No concerns. There is no unsafe code, and pooled buffers are cleared before reuse. Tests: Coverage is good: a byte-identical golden, an LSP reference test against the old encoder, a fold test, a concurrency test and benchmarks. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 18s —— View job Review of PR #948: cheaper semanticTokens [W6-11]I read the diff for Verdict: I found no blocking issues. The change is correct and well contained. Checked and correct
Non-blocking suggestions
Performance
Security: No concerns. There is no unsafe code, and pooled buffers are cleared of document references before reuse. Tests: Coverage is good: a byte-identical golden, an LSP reference test against the old encoder, a fold test, a concurrency test and benchmarks. |
Summary
W6-11 (LSP-2):
highlight.Spanskeeps lexeme/comment/line-start buffers in a pooled scratch and case-folds each lexeme once through a shared buffer; semantic-token encoding is leaner. No public API or behaviour change; ahighlightgolden plus an LSP reference test pin output byte-identical. Follow-ups in this round: merged origin/main (CHANGELOG conflict with #896 resolved, both entries kept under the single### Performanceheading), renamed the misnamedhighlight_bench_test.gotoconcurrency_test.go, and documented the intentionally duplicated emit block inencodeSemanticTokens.Test Plan
task check,task test:cbinding,go test -count=1 ./pkg/compatibility/..., staticcheck on pkg/lsp and pkg/highlight: all pass. One unrelated timing flake (internal/scaletestTestAssertLinearGrowthSlowQuadraticFailsWithinBudget, race shard 2/4) passed on CI rerun.Spans: -12.15% (p<0.001), B/op -84.8%, allocs 252 -> 3LSP/semanticTokens/30KBpostgresql/mysql/sqlserver: -13.3 / -13.9 / -14.3% (p<0.001), B/op -26.4 / -26.8 / -26.0%, allocs ~2000 -> ~20LSP/semanticTokens/1KB: -24.9 / -34.4 / -37.3%;300KB: -12.4 / -17.7 / -18.1%Breaking Changes
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2