feat: parallel rule execution via tokio JoinSet#4
Closed
SpollaL wants to merge 1 commit into
Closed
Conversation
- Replaces sequential for-loop with tokio::task::JoinSet for concurrent rule execution - SessionContext wrapped in Arc<SessionContext> and cloned into each spawned task - Results sorted back to original rule submission order after concurrent completion - run_rules_parallel() extracted as testable public function in runner.rs - Rule and Check derive Clone to support move into tasks - Zero CLI change — pure internal improvement; existing API unchanged - 3 new parallel-specific tests: all-pass, with-failure, order-preservation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
for rule in &rules.rulesloop withtokio::task::JoinSetfor concurrent rule executionSessionContextwrapped inArc<SessionContext>— cloned into each spawned task (zero unsafe)run_rules_parallel()extracted as a public, testable function inrunner.rsRuleandCheckderiveCloneto support move semantics into async tasksPerformance impact
With 10–50 rules on a large Parquet file, rules that previously ran sequentially now run concurrently. Wall-clock time approaches the latency of the single slowest rule rather than the sum of all rule latencies.
Test plan
Arc<SessionContext>signaturetest_parallel_execution_all_pass— 5 rules all pass concurrentlytest_parallel_execution_with_failure— mix of pass/fail rules, correct resultstest_parallel_execution_preserves_order— 10 rules submitted; output matches input order, not completion order🤖 Generated with Claude Code