-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Annotation retrieval performance degradation after 5.2 #23905
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
@quaff I run your test program locally on my box and can confirm your results. In addition to your tests with 5.1.9 and 5.2.0 I can add that in my tests 5.1.11 is still fast, while already the first 5.2.0 milestone M1 shows a degredation. Right from the first glance on the profiler output this time I could not immediately spot an exact cause though. |
@e-hubert I have the same result, it degrade since 5.2.0.M1 . |
In a typical struts2 application, |
|
As we are moving closer towards 5.2.2 milestone completion, I invested a bit more time trying to locate a change causing the reported regression. It looks like the merge commit from 5.1.x to master So next I tried a different approach comparing the HEAD revisons of master and 5.1.x supecting a relation to annotation processing changes (maybe some steps of #22560). I tried to replace a consistent set of classes in master with their 5.1.x predecessors. Only changing the following classes, I could come back to the original performance: Unfortunately, my timebox ended without a concrete result, but nevertheless I wanted to share these intermediate findings, as they might be of help for someone else looking into this. |
@e-hubert Thanks for your efforts, I suspect |
…ostProcessor#injectionMetadataCache org.springframework.beans.factory.annotation.InjectionMetadata#needsRefresh with InjectionMetadata.EMPTY always returns false, And therefore AutowiredAnnotationBeanPostProcessor#find always calls AutowiredAnnotationBeanPostProcessor#buildAutowiringMetadata As a result of this, Performance of constructing component degration happen from 5.1. Ref: spring-projects#23905
This should be partially covered by #24485 now, available in the upcoming |
@jhoeller here is my test results.
|
Just to add, I also double checked with 5.2.5 and 5.2.6-SN and I did not notice a change. |
I've created a separate issue (#24980) for a different solution to the problem in 5.2.6: With that addressed, I'll close this umbrella ticket for its original purpose. Let's create separate issues if any specific optimizations remain that we can address in 5.3, potentially backported to 5.2.x. |
I have a web application based on struts2 and spring, after upgrading to spring 5.2.0, I found performance degraded, I confirm it caused by AutowireCapableBeanFactory.createBean() .
I write an very simple test project AutowirePerformance.zip, 1000000 iterations takes about 2100ms with 5.1.9 but 2800ms with 5.2.0, it means throughput decreased 25%.
#23792 doesn't improve much, @e-hubert would you run this test project and feedback?
The text was updated successfully, but these errors were encountered: