[Perf] Assign standard properties in strict copies #167
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 193 lines diff across 2 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.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #167"
general
weight: 0.35
g4lb
Change
copyStrict, the copier now assigns a standard property (configurable, enumerable and writable) to the clone, instead of a call toObject.defineProperty. It does this only when the prototype of the clone isObject.prototype,Array.prototypeornull, and the property is not found on the clone. The result is the same own property.lengthagain when it is equal to thelengthof the clone.__proto__property, and an array that ends with holes. Each test fails without its guard.The output does not change.
Performance
node benchmark/index.js, ops/sec, median of 4 runs (Node 24, Apple M2 Max):| Object |
main| This branch | Change ||---|---:|---:|---:|
| simple (strict) | 1,699,047 | 3,730,200 | 2.20x |
| complex (strict) | 79,041 | 109,378 | 1.38x |
| big data (strict) | 206 | 442 | 2.15x |
| circular (strict) | 1,521,251 | 2,505,992 | 1.65x |
| special (strict) | 35,061 | 38,858 | 1.11x |
In the same benchmark, loose
copyof the complex object goes from 256,892 to 229,061 ops/sec. This branch does not change the loose code. When I run only the loosecopycases,mainand this branch both give about 229,000 ops/sec. Inmain, the earlier strict cases make the later loose case faster.Checks:
npm run release:scriptspasses.copy,copyStrictand custom copiers.