Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run target source pattern matching in parallel #1197

Merged

Conversation

alvarhansen
Copy link
Contributor

As this transform closure does not access anything outside of its
closure and does not mutate any singletons, then it seems to be safe
to run this mapping in parallel.

In our project with 47 Targets and ~7000 files across them, the project generation time went from 6s to 3.2s:

> hyperfine 'current_xcodegen' 'parallel_xcodegen'
Benchmark 1: current_xcodegen
  Time (mean ± σ):      5.917 s ±  0.123 s    [User: 5.374 s, System: 2.368 s]
  Range (min … max):    5.757 s …  6.078 s    10 runs
 
Benchmark 2: parallel_xcodegen
  Time (mean ± σ):      3.210 s ±  0.045 s    [User: 5.603 s, System: 1.439 s]
  Range (min … max):    3.135 s …  3.276 s    10 runs
 
Summary
  'parallel_xcodegen' ran
    1.84 ± 0.05 times faster than 'current_xcodegen'

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Great, thanks @alvarhansen! Could you add a changelog entry too please

As this transform closure does not access anything outside of its
closure and does not mutate any singletons, then it seems to be safe
to run this mapping in parallel.
@alvarhansen alvarhansen force-pushed the alvar/parallel-source-matches branch from b31aaea to 8e99fd6 Compare March 25, 2022 11:46
@alvarhansen
Copy link
Contributor Author

Great, thanks @alvarhansen! Could you add a changelog entry too please

@yonaskolb, fixed. Added changelog entry.

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Thanks!

@yonaskolb yonaskolb merged commit 17e7b03 into yonaskolb:master Mar 31, 2022
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.

None yet

2 participants