[Perf][SwiftSyntax] Inline the BumpPtrAllocator fast path, and make it final #3472
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 356 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.352
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3472"
general
weight: 0.35
hamishknight
BumpPtrAllocatorandParsingRawSyntaxArenaare now final. Nothing inherits them.BumpPtrAllocator.allocate(byteCount:alignment:),allocate(_:count:)andallocateFromCurrentSlabare now@inlinable.Result
Against
main(8453c53ae), two pairs, instructions and wall clock:| | instructions, pair 1 / pair 2 | wall clock, pair 1 / pair 2 |
| ------------------------------------- | ----------------------------- | --------------------------- |
| parse: MinimalCollections | −3.41% / −3.40% | −2.5% / −2.7% |
| decl_heavy | −3.67% / −3.66% | −3.8% / −2.5% |
| nonascii_heavy | −3.58% / −3.58% | −3.7% / −2.3% |
| corrupt_heavy | −4.64% / −4.64% | −3.5% / −3.6% |
| text consumers:
syntaxTextBytes| +0.04% / +0.00% | +1.0% / +2.2% ||
SourceLocationConverter| +0.05% / +0.04% | +1.1% / +1.6% ||
description| +0.01% / +0.03% | +3.8% / +1.5% || reads: typed accessors | −1.02% / −1.08% | −1.2% / −2.6% |
|
rawTextreads | −1.32% / −1.39% | −2.9% / −1.7% || empty
SyntaxVisitorwalk | −2.91% / −2.88% | −4.0% / −3.7% ||
children(viewMode:)walk | −1.50% / −1.47% | −3.5% / −3.9% |I looked into text consumers (
syntaxTextBytes), they are the same instructions in the asm, but still it measures slower, I _think_ it's something with the code's placement rather than the instructions.Each change on its own, instructions:
| |
finalonly | inlined bump only | both || -------------------------- | --------------- | ----------------- | ------ |
| parse MinimalCollections | −0.52% | −2.28% | −3.41% |
| parse decl_heavy | −0.52% | −2.40% | −3.67% |
| parse nonascii_heavy | −0.90% | −2.04% | −3.58% |
| parse corrupt_heavy | −2.83% | −1.47% | −4.64% |
| empty
SyntaxVisitorwalk | −0.06% | −2.90% | −2.91% ||
children(viewMode:)walk | +0.04% | −1.50% | −1.50% || code size (
__text) |finalonly | inlined bump only | both || -------------------- | ------------ | ----------------- | -------------------- |
| SwiftSyntax | +112 bytes | +5,324 bytes | −1,776 bytes (−0.1%) |
| SwiftParser | −4,164 bytes | −8 bytes | −2,452 bytes (−0.4%) |