Skip to content

perf: parallelize dependency resolution after registration#4681

Merged
thomhurst merged 1 commit intomainfrom
perf/parallelize-dependency-resolution
Feb 6, 2026
Merged

perf: parallelize dependency resolution after registration#4681
thomhurst merged 1 commit intomainfrom
perf/parallelize-dependency-resolution

Conversation

@thomhurst
Copy link
Owner

Summary

  • Add `BatchResolveDependencies` method using `Parallel.ForEach` for the resolution phase
  • Safe to parallelize because after registration completes, lookup dictionaries (`_testsByType`, `_testsByMethodName`, `_allTests`) are effectively read-only
  • Each test's `Dependencies` field is only written by its own resolution (no cross-test writes)
  • Replaces sequential `foreach` + `TryResolveDependencies` in both discovery paths

Test plan

  • Verify test dependencies resolve correctly (same-class and cross-class)
  • Verify transitive dependencies work
  • Verify DependsOn attribute behavior is preserved
  • Run full engine test suite

🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Feb 6, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@thomhurst thomhurst enabled auto-merge (squash) February 6, 2026 08:49
Add BatchResolveDependencies using Parallel.ForEach for the resolution
phase. After registration completes, lookup dictionaries are effectively
read-only and each test's Dependencies are written independently, making
this safe to parallelize.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thomhurst thomhurst force-pushed the perf/parallelize-dependency-resolution branch from 51c46f5 to 51d314c Compare February 6, 2026 09:39
@thomhurst thomhurst merged commit 9826b85 into main Feb 6, 2026
12 of 13 checks passed
@thomhurst thomhurst deleted the perf/parallelize-dependency-resolution branch February 6, 2026 10:29
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