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

Performance Fixes #99

Merged
merged 2 commits into from
May 22, 2019
Merged

Conversation

tpetrov-rms
Copy link
Contributor

Two performance fixes without which the build takes minutes in the configuration phase for multi-module projects with a lot of cross-references.

  1. Loads the plugin just one time, instead of loading separately for each module. Debug logging showed that sometimes, this operations takes 10 sec (on some machines at least).

  2. The more critical issue was in recursiveDependenciesOf. Without caching of the results, the same operations are repeated over and over again and it takes minutes to configure.

For a work project I have, with 16 modules, with a lot of cross-references, adding the scoverage plugin without these fixes takes 5-10 mins. The worst of it is that this is the wait time for each change in any build.gradle (e.g. adding a new dependency), which makes the work nearly impossible. After applying the fixes, there is no significant difference with the time taken without the scoverage plugin.

…nfiguration phase for multi-module projects with a lot of cross-references.

1. Loads the plugin just one time, instead of loading separately for each module. Debug logging showed that sometimes, this operations takes 10 sec (on some machines at least).

2. The more critical issue was in `recursiveDependenciesOf`. Without caching of the results, the same operations are repeated over and over again and it takes minutes to configure.

For a work project I have, with 16 modules, with a lot of cross-references, adding the scoverage plugin without these fixes takes 5-10 mins. The worst of it is that this is the wait time for each change in any build.gradle (e.g. adding a new dependency), which makes the work nearly impossible. After applying the fixes, there is no significant difference with the time taken without the scoverage plugin.
@tpetrov-rms
Copy link
Contributor Author

@maiflai this is the first time I make PRs to this repo, so I don't know if I have to ping people or you get notifications on any proposed PRs anyway.

@maiflai
Copy link
Contributor

maiflai commented May 21, 2019

Thanks very much - I'll try to take a look in the next couple of days.

Stu

@maiflai maiflai merged commit 7e7e792 into scoverage:master May 22, 2019
@tpetrov-rms
Copy link
Contributor Author

@maiflai thanks for merging this! One hopefully last question. At what intervals do you push new versions to maven-repository? Do you have the practice of pushing updates like this one as minor versions e.g. 3.0.1
Trying to understand when we can use these updates from the main repo and not from the fork.

@maiflai
Copy link
Contributor

maiflai commented May 23, 2019

Sorry - this is normally pushed to maven central at the same time as the gradle plugin repository.

However, I think something has changed at Sonatype because they now require a javadoc before it can be released.

I seem to recall that this was relaxed for the groovy projects a while ago, I need to chase them for an answer.

Stu

@tpetrov-rms
Copy link
Contributor Author

Please, let me know when you have some answers. Appreciate it!

@maiflai
Copy link
Contributor

maiflai commented May 23, 2019

I didn't read the error message properly - 'no javadoc' is the name of the profile, not a failed test.

I've now managed to publish to maven central, 3.1.1 should be visible now.

@tpetrov-rms
Copy link
Contributor Author

I can see 3.0.0 only just yet. https://mvnrepository.com/artifact/org.scoverage/gradle-scoverage

It may take some time.

@eyalroth
Copy link
Contributor

eyalroth commented Aug 9, 2019

@tpetrov-rms Thank you for the contribution :)

I have a question though - when does the taskDependencies map gets cleaned? I'm not sure whether a new instance of ScoveragePlugin gets instantiated per build or only once per JVM (and whether this behavior changes between running with the gradle daemon or not).

It is important that the map will reset on every build as there might be changes in those dependencies from build to build as project configuration changes.

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.

3 participants