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
Perform basic property determination without java.beans.Introspector #29320
Comments
Our initial experience with this is pretty compelling, both for native images and for regular JVM deployments. In microbenchmarks, the new "basic" discovery is about 10 times faster than "standard" Introspector usage when It's worth noting that the algorithm can be customized in 5.3 as well, using the We could potentially backport such a |
Have you measured the memory impact, by any chance? |
We're substituting the same thing for native images: No memory numbers yet. The footprint is as minimal as possible now, so I would expect a measurable difference. Like with startup time, not sure whether it will really matter in regular application bootstrap, but it's the best we can do in terms of streamlining for the introspection functionality that 99.9% of Spring-based applications actually need. For the time being, I've extracted a |
For completeness reasons if someone is interested: https://github.com/dreis2211/remove-introspector-customizer-agent |
The 5.3.x backport should be available in the current snapshot there now: #29330 |
…rn type) Also avoids unnecessary checks in name-based PropertyDescriptor constructor. See gh-29320
Out of a discussion in #26884, we should replace our beans introspection with a basic property determination algorithm that discovers the common scenarios for Spring applications but nothing more: no indexed properties, no JDK-level customizers, etc. This significantly streamlines the discovery process on startup and allows for straightforward usage in a native image (not relying on Introspector substitutions).
The implementation that is about to be pushed for RC2 gets rid of all common
java.beans.Introspector
usage points in the codebase, replacing them with calls toPropertyDescriptorUtils.determineBasicProperties
andStringUtils.uncapitalizeAsProperty
. The entire core test suite passes with this.Standard JavaBeans Introspector usage can be enforced through
StandardBeanInfoFactory
configuration in aMETA-INF/spring.factories
file (a mechanism which existed for BeanInfo customizations before) with the following content:org.springframework.beans.BeanInfoFactory=org.springframework.beans.StandardBeanInfoFactory
For Spring 5.3 compatible extended introspection including non-void setter methods:
org.springframework.beans.BeanInfoFactory=org.springframework.beans.ExtendedBeanInfoFactory
Neither of the two should be commonly necessary.
The text was updated successfully, but these errors were encountered: