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

Launch multiple configurations in parallel #1351

Open
pavel-trafimuk opened this issue Jul 19, 2024 · 3 comments
Open

Launch multiple configurations in parallel #1351

pavel-trafimuk opened this issue Jul 19, 2024 · 3 comments

Comments

@pavel-trafimuk
Copy link
Contributor

Currently we have 150+ modules with 300+ targets in project,
each module has same assembly+injection code which is auto-generated by Sourcery.
To make generation faster, we're preparing list of ymls (1 per module) and launch sourcer(y)-ies in parallel for each module=yml.
Codebase (source files and output files) doesn't intersect, so it works well.

Im looking how we can improve performance of this approach.
One of found 'issues' - each sourcery is separated instance, so some unified values each time are loading, e.g. templates.
Much better to have one Sourcery instance, also it already supports having one yml with multiple configations. So I can combine all 150 ymls in one and launch Sourcery one time
BUT as I see in the code, in such case Sourcery launches these sub-configurations in serial, not parallel.
Does it some special limitation or maybe It's just not implemented yet.
To understand better, pls look around let keepAlive = try configurations.flatMap

@art-divin
Copy link
Collaborator

Hello @pavel-trafimuk ,

thank you for creating this issue.
Just as a note, did you check out my article on parallelization of Sourcery when generating mocks here?

It might just be what you need, but of course, there are always ways to optimize Sourcery more and more.

Article is about using swifttemplate templates.

@pavel-trafimuk
Copy link
Contributor Author

pavel-trafimuk commented Jul 19, 2024

Ok, will jump in it and later come back with more stupid ideas ))
Anyway most of the templates are Stencil, we have only one swifttemplate and always want to replace it on stencil
(we even moved from SwiftyMocky to stencil automockable - swifttemplates were too long for our codebase)

@msnazarow
Copy link

Is there any updates? Fasing same issue

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

No branches or pull requests

3 participants