-
Notifications
You must be signed in to change notification settings - Fork 682
Too excessive component scanning for repository implementation fragments causing slow bootstrap [DATACMNS-1172] #1614
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
Comments
Oliver Drotbohm commented Do you have more information you can add as otherwise it's really hard to act on what you describe. Looks like the actual bottleneck is a class in Spring Framework. I'd be interested in how many repository interfaces your project contains, and whether they're located in packages with many sub-packages |
Réda Housni Alaoui commented Hello Oliver, The app has:
The scanned root package is present in a dozen of jars |
Réda Housni Alaoui commented My laptop is a 2017 Razer Blade with nvme disk, 16 GB of RAM and Core i7 Quad Core 6700HQ running Ubuntu 17. |
Anthony Donnefort commented According to the documentation:
This is not the case. CustomRepositoryImplementationDetector looks for the implementation anywhere in the base package. Limiting the package search as documented would probably fix the problem |
Mark Paluch commented I pushed a branch with a proposal that aligns scanning to how it's documented, we scan only for custom implementations in the package where the actual repository interface/fragment interface resides. That's a change in comparison to how scanning works today. We need to extend our @EnableJpaRepositories(limitImplementationBasePackages = false)
@Configuration
class AppConfiguration {
// …
} |
Mark Paluch commented We deployed snapshot versions for Hopper and Ingalls that limit implementation scanning to the repository package. Care to give the change a spin? Hopper: <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.12.12.DATACMNS-1172-SNAPSHOT</version>
</dependency> Ingalls: <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.13.8.DATACMNS-1172-SNAPSHOT</version>
</dependency> You can obtain the artifacts from our snapshot repository: <repositories>
<repository>
<id>spring-libs-snapshot</id>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
</repositories> |
Anthony Donnefort commented On two different usecases init time for spring data with this snapshot went from 30s to 5s, and 1m30 to 20s. |
Oliver Drotbohm commented That's now merged into Ingalls and Hopper bugfix branches as well as master for Kay. I didn't merge the addition of a config option top enable exhaustive scanning again, to see whether users were really relying on that |
Réda Housni Alaoui opened DATACMNS-1172 and commented
We are using
Spring Data JPA 1.10.11.RELEASE
, therefore usingSpring Data Commons 1.12.11.RELEASE
. Integration test boot is particularly slow on our biggest application. After some digging, we found out that Spring Data ignition viaCustomRepositoryImplementationDetector.detectCustomImplementation()
takes 45 seconds.I didn't find any issue opened on Spring Framework or Spring Data about this. I didn't notice a massive change of this part of the source code in the incoming Spring Data 2.0. This discourages our collaborators from writing integration test
Affects: 1.12.11 (Hopper SR11), 2.0 RC3 (Kay), 1.13.7 (Ingalls SR7)
Attachments:
Referenced from: pull request #248
Backported to: 1.13.8 (Ingalls SR8), 1.12.12 (Hopper SR12)
2 votes, 5 watchers
The text was updated successfully, but these errors were encountered: