enhancement(path): check field quoting without a regex #2085
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 249 lines diff across 3 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.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2085"
general
weight: 0.35
pront
Summary
OwnedSegment'sDisplayimpl matched every field against a staticRegex(^[0-9][a-zA-Z_@][0-9a-zA-Z_@]$) to decide whether it needs quotes. A staticRegexhas a single cache pool for the whole process: the first thread to use it gets the fast path, and every other thread goes throughPool::get_slow/put_value, which contend on a handful of sharded mutexes. Paths are formatted per event on hot paths (for example in Vector'sreducetransform), so this shows up in CPU profiles on multi-core hosts.This replaces the regex with a byte check that follows the same rules, like
serialize_fieldin the same file already does.How did you test this PR?
Regex::is_matchagainst the new check, 8 typical field names, per call per thread, on a 16-core machine:| threads | regex | byte check |
|---|---|---|
| 1 | 26.0 ns | 3.9 ns |
| 4 | 55.7 ns | 4.0 ns |
| 8 | 60.8 ns | 4.1 ns |
| 16 | 129.7 ns | 6.1 ns |
Does this PR include user-facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool writeand commit the changes. More details here.References