Skip to content

Optimize performance of autowiring for Groovy/Grails [SPR-11864] #16483

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

Closed
spring-projects-issues opened this issue Jun 10, 2014 · 1 comment
Closed
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 10, 2014

Lari Hotari opened SPR-11864 and commented

In Grails there is a custom solution to optimize autowiring by name.
Grails autowires all objects that are retrieved from Hibernate (GORM) . That's why the performance of autowiring is really critical for Grails.

This is the BeanFactory implementation Grails uses:
https://github.com/grails/grails-core/blob/master/grails-core/src/main/groovy/org/grails/spring/beans/factory/OptimizedAutowireCapableBeanFactory.java
(or rev 6d3604a if that link is broken)

It would be nice to have some caching like this directly in Spring.
Some usecases (I was perf. testing with) were 300% faster with this change at the time I added that optimization, so it's quite important for Grails applications.
There are some drawbacks in the solution used in Grails. The use of the optimizations can be skipped for a single class by making the class implement the Aware marker interface.

I wouldn't recommend to use a similar implementation directly in Spring, but I'd like to see autowiring by name optimized for performance directly in Spring.


Affects: 4.0.5

Issue Links:

2 votes, 6 watchers

@spring-projects-issues
Copy link
Collaborator Author

Lari Hotari commented

any updates on this issue? The issue https://jira.grails.org/browse/GRAILS-11965 in Grails Jira depends on this issue. I assume we will use the previous solution for 3.0 GA because of the current release schedule (GA target date in March). We would like to get rid of custom solutions in the long run so it would be nice if this issue gets solved in Spring 4.2 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants