Skip to content

⚡ Bolt: [performance improvement] eliminate zero-allocation block id references on scheduler tick#54

Closed
ovasylenko wants to merge 3 commits into
mainfrom
bolt/zero-allocation-get-batch-16431544039206705856
Closed

⚡ Bolt: [performance improvement] eliminate zero-allocation block id references on scheduler tick#54
ovasylenko wants to merge 3 commits into
mainfrom
bolt/zero-allocation-get-batch-16431544039206705856

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

💡 What: Changed the get_block_outputs_batch storage trait to accept a tuple with a &BlockId reference rather than an owned BlockId, allowing callers to simply push borrowed references from iteration loops without .clone()ing.

🎯 Why: In orch8-engine/src/scheduler.rs, the scheduler parses out SLA deadline checks for all incomplete block steps. Previously, checking deadlines allocated a brand new string for every distinct step_def.id.clone() just to query for an output in the database cache.

📊 Impact: Significantly reduces string allocations during the hot path process_instance loop ticks, particularly for high-concurrency loops on big sequences.

🔬 Measurement: Cargo workspace unit tests run via cargo test -p orch8-engine and cargo test -p orch8-storage should pass without performance regressions.


PR created automatically by Jules for task 16431544039206705856 started by @ovasylenko

Updated `get_block_outputs_batch` trait to accept `&[(InstanceId, &BlockId)]` instead of `&[(InstanceId, BlockId)]` to eliminate string clones on the scheduler fast path. Added inline comments documenting the optimization reason.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits June 8, 2026 20:03
Updated `get_block_outputs_batch` trait to accept `&[(InstanceId, &BlockId)]` instead of `&[(InstanceId, BlockId)]` to eliminate string clones on the scheduler fast path. Added inline comments documenting the optimization reason. Fix code formatting to align with stable rustfmt used in CI pipeline.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
Updated `get_block_outputs_batch` trait to accept `&[(InstanceId, &BlockId)]` instead of `&[(InstanceId, BlockId)]` to eliminate string clones on the scheduler fast path. Added inline comments documenting the optimization reason. Fix code formatting to align with stable rustfmt used in CI pipeline.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
@ovasylenko

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #53, which implemented the identical optimization (get_block_outputs_batch accepting &[(InstanceId, &BlockId)] to drop the per-tick BlockId clone). #53 was the only one of the four variants with fully-green CI (this one failed Check & Lint on an unrelated rustfmt diff in orch8-api/src/instances.rs), so it was merged. Thanks Bolt.

@ovasylenko ovasylenko closed this Jun 10, 2026
@ovasylenko ovasylenko deleted the bolt/zero-allocation-get-batch-16431544039206705856 branch June 10, 2026 04:36
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing as a duplicate of #53, which implemented the identical optimization (get_block_outputs_batch accepting &[(InstanceId, &BlockId)] to drop the per-tick BlockId clone). #53 was the only one of the four variants with fully-green CI (this one failed Check & Lint on an unrelated rustfmt diff in orch8-api/src/instances.rs), so it was merged. Thanks Bolt.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant