Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
ReflectivePropertyAccessor should cache sorted methods [SPR-16882] #21421
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
Backported to: 4.3.18
0 votes, 5 watchers
Pavel Khokhlov commented
I have a question. I've checked release version 4.3.18 and I didn't find significant difference, look:
So what was fixed? Could you explain it please?
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.
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.