⚡ Bolt: [Avoid intermediate Vec allocations in execution tree hot paths] - #84
⚡ Bolt: [Avoid intermediate Vec allocations in execution tree hot paths]#84ovasylenko wants to merge 3 commits into
Conversation
…t paths Replaced the `children_of(...).into_iter().any(...)` pattern with a direct, zero-allocation short-circuiting `.iter().any(...)` on the execution tree in `orch8-engine/src/evaluator.rs`. This eliminates intermediate `Vec` creations in high-frequency cancellation and dispatch paths like `is_inside_decided_race` and `has_racing_composite_sibling`. Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…t paths Replaced the `children_of(...).into_iter().any(...)` pattern with a direct, zero-allocation short-circuiting `.iter().any(...)` on the execution tree in `orch8-engine/src/evaluator.rs`. This eliminates intermediate `Vec` creations in high-frequency cancellation and dispatch paths like `is_inside_decided_race` and `has_racing_composite_sibling`. Also updated `anyhow` to fix `RUSTSEC-2026-0190` flagged by CI `cargo deny`. Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
|
Same situation as #82: this PR implements the identical fix to |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
|
Closing as superseded — see comment above (identical fix landed via #89). |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What: Replaced usages of the
children_ofhelper function (which clones references into an intermediateVec) within.any(...)loops to directly iterate over thetreeslice using.iter().any(|c| ...).🎯 Why: In recursive evaluation loops (
is_inside_decided_race,has_racing_composite_sibling), allocating aVecjust to test a boolean condition across children introduces unnecessary heap allocation and bypasses the performance benefits of short-circuiting iterators (since theVecmust be fully populated before.any(...)is checked).📊 Impact: Reduces memory allocation frequency and overall CPU cycle time during tree traversals for step dispatch and cancellation checks on deep execution graphs, as memory no longer needs to be allocated and garbage collected for these intermediate arrays.
🔬 Measurement: Verified that tests pass via
cargo test -p orch8-engineand formatting is correct viacargo +stable fmt. The optimization removes twoVecallocations per parent node visited during evaluation in these branches.PR created automatically by Jules for task 127087307332190317 started by @ovasylenko