Skip to content

Conversation

@ryzhyk
Copy link
Contributor

@ryzhyk ryzhyk commented Jan 10, 2026

Metadata exchange + balancer add an extra round of communication to each step. Since we don't support balanced joins in non-root circuits, this part can be optimized away.

Metadata exchange + balancer add an extra round of communication to each step.
Since we don't support balanced joins in the root circuit, this part can be
optimized away.

Signed-off-by: Leonid Ryzhyk <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the dynamic scheduler by disabling metadata exchange and balancer operations in non-root circuits. Since balanced joins are not supported in non-root circuits, these operations add unnecessary communication overhead that can be eliminated.

Changes:

  • Added root_scope() checks to conditionally skip balancer operations in non-root circuits
  • Modified exchange_metadata to early-return for non-root circuits, preventing metadata broadcast
  • Guarded all six balancer method calls with root_scope() == 0 checks

Comment on lines +522 to +524
}
}
if circuit.root_scope() == 0 {
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two consecutive if circuit.root_scope() == 0 blocks at lines 520-523 and 524-526 could be consolidated into a single block for better readability and maintainability. Consider combining them to reduce code duplication of the condition check.

Suggested change
}
}
if circuit.root_scope() == 0 {
circuit.balancer().start_step();
}
} else if circuit.root_scope() == 0 {

Copilot uses AI. Check for mistakes.
@ryzhyk ryzhyk added this pull request to the merge queue Jan 11, 2026
Merged via the queue into main with commit efe10f1 Jan 11, 2026
7 checks passed
@ryzhyk ryzhyk deleted the no-metadata-with-recursion branch January 11, 2026 01:16
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.

3 participants