Skip to content

Commit

Permalink
Merge pull request #22294 from dreis2211
Browse files Browse the repository at this point in the history
* gh-22294:
  Reduce started threads in OnClassCondition

Closes gh-22294
  • Loading branch information
wilkinsona committed Jul 14, 2020
2 parents 196d205 + 60e7146 commit 9dea67f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -49,7 +49,7 @@ protected final ConditionOutcome[] getOutcomes(String[] autoConfigurationClasses
// Split the work and perform half in a background thread if more than one
// processor is available. Using a single additional thread seems to offer the
// best performance. More threads make things worse.
if (Runtime.getRuntime().availableProcessors() > 1) {
if (autoConfigurationClasses.length > 1 && Runtime.getRuntime().availableProcessors() > 1) {
return resolveOutcomesThreaded(autoConfigurationClasses, autoConfigurationMetadata);
}
else {
Expand Down

0 comments on commit 9dea67f

Please sign in to comment.