-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
ReflectivePropertyAccessor should cache sorted methods [SPR-16882] #21421
Comments
Pavel Khokhlov commented Probably problem in method getSortedClassMethods Line 433 in c44de3c
it calls too often and should be cached. |
Pavel Khokhlov commented
I have a question. I've checked release version 4.3.18 and I didn't find significant difference, look: 4.3.18.RELEASE
256738.959 ops/s
4.3.9.RELEASE
584558.688 ops/s So what was fixed? Could you explain it please?
|
Juergen Hoeller commented The change was in the sorted method handling that you pointed out above... we're caching the sorted method array now. I suppose there is some other hotspot involved too then? |
Kanthi Vaidya commented Hi Juergen, I saw your code changes for caching the SortedMethods. We don't benefit much if you don't make your ConcurrentHashMap of sorted methods a static variable. Even after making the ConcurrentHashMap a static variable, we still don't get back the original performance of the prior spring versions. It definitely helps of course. This is just one hotspot. More benchmarking and profiling is needed to identify other hot spots. And it probably makes sense to add a test case to the CI infrastructure to catch any such degradations. This performance degradation, is preventing us from migration to Spring 5. |
Kanthi Vaidya commented
|
Juergen Hoeller commented Please create a new issue as a follow-up to this one. I'll schedule that new issue for 5.1 RC1 then. Being at it, I'll rename this issue here to specifically cover the sorted methods cache that has been introduced in 4.3.18. |
Pavel Khokhlov opened SPR-16882 and commented
After migration from SPEL 4.3.9.RELEASE -> 4.3.10.RELEASE we noticed performance degradation with SPEL Expression (at least 2.5x times).
In attachment you can find [^benchmark.zip]
You can see JMH report (I used jdk1.8.0_151)
This is 4.3.10.RELEASE
This is 4.3.9.RELEASE
Affects: 4.3.10
Attachments:
Issue Links:
Referenced from: commits 4a6e9a5, bfcc1a1, da049f4, e2ccd55
Backported to: 4.3.18
0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: