Skip to content

⚡ Bolt: [Zero-Allocation Batch Query Parameters]#51

Closed
ovasylenko wants to merge 2 commits into
mainfrom
bolt/zero-allocation-blockid-batch-5955647547027662294
Closed

⚡ Bolt: [Zero-Allocation Batch Query Parameters]#51
ovasylenko wants to merge 2 commits into
mainfrom
bolt/zero-allocation-blockid-batch-5955647547027662294

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

💡 What: Updated the get_block_outputs_batch signature in orch8-storage to accept &[(InstanceId, &BlockId)] instead of &[(InstanceId, BlockId)]. Updated the caller in orch8-engine/src/scheduler.rs to pass references.
🎯 Why: Previously, the scheduler's deadline check fast-path collected pairs by calling deadline_keys.push((instance.id, step_def.id.clone())). Since BlockId wraps a String, this created thousands of unnecessary heap allocations per minute in highly concurrent setups.
📊 Impact: Eliminates BlockId string cloning on the scheduler tick hot-path for SLA checks, significantly reducing memory allocation overhead.
🔬 Measurement: Verified the compilation with cargo check and ensured all tests in orch8-engine and orch8-storage pass cleanly. Observe reduced heap allocations during scheduler ticks.


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

Updates `get_block_outputs_batch` trait signature and implementations to
accept `&BlockId` instead of an owned `BlockId` in its keys array.

This avoids thousands of `String` clones per minute in the scheduler's
deadline check hot-path.

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.

Updates `get_block_outputs_batch` trait signature and implementations to
accept `&BlockId` instead of an owned `BlockId` in its keys array.

This avoids thousands of `String` clones per minute in the scheduler's
deadline check hot-path.

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-blockid-batch-5955647547027662294 branch June 10, 2026 04:36
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