perf: array forwarding compression, shared add-tree guards, packed shape guards - #8682
Conversation
…ape guards Lands three reviewed PRs as one squash: #8674, #8675, #8676. - #8674: compress array forwarding chains (`clean_arr_ptr` multi-hop walk). - #8675: share numeric guards across dynamic add trees. - #8676: pack monomorphic method shape guards. These three were authored as a stack on top of #8672, but their contents touch disjoint files, so they are cherry-picked onto main on their own. #8672 is NOT included: it defines its own `is_bound_native_method_closure_value` (true for any bound native-module export with a non-empty module name), which #8662 superseded on main with the strictly narrower `is_bound_native_constructor_closure_value` (gated on explicit constructor metadata). Those predicates have different truth sets, so the substitution is a behavioural change at every call site and is left to the author to rebase. Also splits `array/tests.rs`, which #8674 pushed over the 2000-line cap, into an `array/forwarding_tests.rs` sibling. Pure relocation. Version bump not included per maintainer policy.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughChangesThe PR adds three performance changes: array forwarding-chain compression, shared numeric guards for dynamic addition trees, and packed method-shape validation. Each change includes focused tests or updated assertions and a performance changelog entry. Array forwarding compression
Dynamic addition tree lowering
Packed method-shape guards
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lands three reviewed PRs as one squash: #8674, #8675, #8676.
clean_arr_ptrmulti-hop walk)Why #8672 is not in this batch
All four were authored as one stack on top of #8672, so each PR head carries #8672's commit. Their contents, however, touch disjoint files, so these three are cherry-picked onto
mainon their own.#8672 is held deliberately. It defines its own
is_bound_native_method_closure_value, which returns true for any bound native-module export with a non-empty module name.main(via #8662) superseded that withis_bound_native_constructor_closure_value, which returns true only for an actual constructor, gated on explicit constructor metadata:Different truth sets — main's is strictly narrower. Substituting one for the other is a behavioural change at every call site, not a mechanical rename, so it needs the author's judgment rather than mine.
File-size cap
#8674 pushed
array/tests.rsfrom 1998 to 2034 lines, over the 2000-line gate. Split the growth-forwarding group (install_array_growth_forwarding_*plus the threeclean_arr_ptrchain-walk tests) into anarray/forwarding_tests.rssibling, following the existingsubclass_testspattern. Pure relocation.Validation (on the merged result)
cargo fmt --all --check: passperry-codegen --lib: 1198 passed, 0 failed (+4)perry-runtime --lib(RUST_TEST_THREADS=1): 2652 passed, 0 failed (+1)array::forwarding_tests::*, crate total unchangedNo version-file changes; three
changelog.d/fragments carried through.Summary by CodeRabbit
Performance Improvements
Reliability