We validated this fix against our production monorepo (~750 targets) and can confirm a significant, measurable improvement.
Local benchmarks (Tuist 4.194.4, M-series Mac, tuist generate against our full iOS project):
| Scenario | Without fix | With fix |
|---|---|---|
| Cold generate | 232s | 181s (-22%) |
| Warm generate (run 1) | 21s | 15s (-29%) |
| Warm generate (run 2) | 20s | 15s (-25%) |
The improvement is consistent across cold and warm runs. The O(n²) from workspace.projects.filter { projects.map(\.path).contains($0) } rebuilding the array on every iteration becomes very visible at our target count.
Would love to see it merged in an upcoming release. Happy to help test a pre-release build if useful.
cc @fortmarek