Phil Webb opened SPR-15512 and commented
During some discussion on the Spring Boot call about this issue we discussed the benefits of not needing to use CGLib for configuration classes.
A typical Spring Boot application will load 50-70 configurations and each one needs bytecode generation and increases the amount of memory used.
One option that Stephane suggested was to do the bytecode manipulation an compile time rather than runtime. We could possibly use an annotation processor to rewrite the methods and call some common SPI that both ConfigurationClassEnhancer
and us could share.
0 votes, 6 watchers
Comment From: spring-projects-issues
Phil Webb commented
One other thought about this. We'd need to ensure that debugging works correctly. We don't want line numbers changing.
Comment From: bclozel
Closing as a duplicate of #28065.
In the meantime, we've decided to perform @Configuration
classes analysis during the AOT phase and generate Java sources that describe the state of the resulting bean factory.