Skip to content

Performance degradation for creating non-singleton bean [SPR-16514] #21057

@spring-projects-issues

Description

@spring-projects-issues

Jakub Bednar opened SPR-16514 and commented

In our system we use the short live non singleton bean. After upgrade to Spring 5.0.3 our performance tests has performance degradation caused by slowdown the bean creation. Here is a speed comparison between the Spring 4.3.6 and the Spring 5.0.3:

Spring 4.3.6.RELEASE

PerformanceIssue - 1000 bean creations 67 ms
PerformanceIssue - 10000 bean creations 161 ms
PerformanceIssue - 100000 bean creations 222 ms

Spring 5.0.3.RELEASE

PerformanceIssue - 1000 bean creations 100 ms
PerformanceIssue - 10000 bean creations 296 ms
PerformanceIssue - 100000 bean creations 1894 ms

This problem is caused by Assert.notNull in method AnnotationUtils.synthesizeAnnotation. See the YourKit call tree:

Spring 4.3.6.RELEASE
!YourKit-Spring4.png|thumbnail!

Spring 5.0.3.RELEASE
!YourKit-Spring5.png|thumbnail!


Affects: 5.0.3

Reference URL: https://github.com/bednar/spring-5-performance-issue

Attachments:

Referenced from: commits f316f6a

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions