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

Parallelise Report Generator #696

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

afscrome
Copy link
Contributor

I've had a go at trying to parallelise the report generation - aimed particularly at helping GitHub Actions / Azure DevOps where the report generator can be quite slow, presumably due to disk IO. I've read some issues about previous attempts and realised it's not as simple as processing classes in parallel as not all the IReportBuilder implements support concurrency.

With this in mind, I believe two parts of the report generation process (ReportGenerator) can be parallelised

  1. The initial File Analysis can be done concurrently with the report generation
  2. Introduced IParallelisableReportBuilder - IReportBuilders that also implement IParallelisableReportBuilder can then be processed in parallel

this PR has a draft implementation of this, and with the change, I have been able to get report generation (measuring time spent in Generator.GenerateReport) down from 21 secs to down as low as 4 seconds with extreme concurrency, and 6secs with more reasonable concurrency levels.

This PR is still a bit of a work in progress - in particular I need to plumb the concurrency level through as a config option, and I also want to do some testing with GitHub Actions / Azure Devops. However I wanted to raise it in it's current form for some initial thoughts on the approach.

Note, this parallelisation change highly benefits form #695

I've had a go at trying to parallelise the - aimed particularly at helping GitHub Actions / Azure DevOps where the report generator can be quite slow, presumably due to disk IO.  I've read some issues about previous attempts and realised it's not as simple as processing classes in parallel as not all the `IReportBuilder` implements support concurrency.

With this in mind, I believe two parts of the report generation process (`ReportGenerator`) can be parallelised

1. The initial File Analysis can be done concurrently with the report generation
2. Introduced `IParallelisableReportBuilder` - `IReportBuilder`s that also implement `IParallelisableReportBuilder` can then be processed in parallel

this PR has a draft implementation of this, and with the change, I have been able to get report generation (measuring time spent in `Generator.GenerateReport`) down from 21 secs to down as low as 4 seconds with extreme concurrency, and 6secs with more reasonable concurrency levels.

This PR is still a bit of a work in progress - in particular I need to plumb the concurrency level through as a config option, and I also want to do some testing with GitHub Actions / Azure Devops.  However I wanted to raise it in it's current form for some initial thoughts on the approach.

Note, this parallelisation change highly benefits form #TODO
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