-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Performance degradation due to Kotlin value class checks #32334
Comments
The analysis of the flame graphs confirmed this issue, and I have been able to check on my side that the fix I just pushed bring back the performances to the pre-regression level. Feel free to double check with |
I have checked a lot of improvements. Because it is registered as AOP, it has a performance impact because it is executed on every call to the suspend method registered with the bean. |
For more performance optimizations, #21546 will likely be needed so feel free to vote for this issue that I am actively reviewing. |
I left it in because I thought it was a change since that issue, rather than an optimization. Thank you always for creating a framework that is easy to use. 👍 |
I have refined the optimizations in order to leverage @koo-taejin @efemoney Please check Notice I will likely do shortly another pass of optimization for Coroutines. |
Unfortunately, I don't think the situation has changed much. Method of Also, in the latest version, the isSubTypeOf() method uses resources. This is called for every If there is anything I can do to help, please let me know. Thank you so much. 🙇 |
Should be slightly faster. See spring-projectsgh-32334
I had another look but I can't really optimize much more without using a cache. I discussed with the Kolin team the possibility to use Concerning I would suggest that we don't go further for 6.1.5 as with #32390 optimizations should limit the performance regression we see with value type checks, or even provide better performances (this is what I see in my benchmarks). If that's not enough, I guess we will need to explore if a cache is worth to introduce, but that if we go that path, that will probably have to wait for 6.2 as some refactoring will be needed to have a single cache for the various use cases. |
Thank you for your thoughtful consideration. |
Affects: : >=
6.1.2
Related issue : #31698
Since spring-boot 3.2.1, we have noticed a significant performance drop in our application.
A colleague of mine (@koisyu) have tried to figure out the cause.
He had analyzed that loading the Java class every time while invoking
getClassifier()
fromKType
was the reason.I think that if cache these parts, spring-framework can use this feature with similar performance as before.
Steps to reproduce
This is a very simple Kotlin-based controller method that makes it easy to test.
benchmark
async-profiler
spring-boot 3.2.0
spring-boot 3.2.1
The text was updated successfully, but these errors were encountered: