Skip to content

Some trivial optimization in method populateBean() #22792

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

Merged
merged 2 commits into from
Apr 23, 2019

Conversation

hecenjie
Copy link

@hecenjie hecenjie commented Apr 14, 2019

I don't think it's necessary to call the same get method so many times, maybe can do some trivial optimization here.

@pivotal-issuemaster
Copy link

@cenjieHo Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@cenjieHo Thank you for signing the Contributor License Agreement!

@hecenjie hecenjie changed the title some negligible optimization in method populateBean() Some negligible optimization in method populateBean() Apr 14, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 14, 2019
Optimize the number of getResolvedAutowireMode() method calls
@hecenjie hecenjie changed the title Some negligible optimization in method populateBean() Some trivial optimization in method populateBean() Apr 14, 2019
@sbrannen sbrannen requested a review from jhoeller April 14, 2019 11:12
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Apr 14, 2019
@jhoeller jhoeller self-assigned this Apr 14, 2019
@jhoeller jhoeller added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 14, 2019
@jhoeller jhoeller added this to the 5.2 M2 milestone Apr 14, 2019
@jhoeller
Copy link
Contributor

Thanks for raising this! Even if such field access through method calls is usually very efficient at runtime, this is worth changing for clarification purposes in any case: namely evaluating the same state of the field, never getting a different autowire mode returned from that getter. A one-time method call with a locally cached result makes this clear.

@jhoeller jhoeller merged commit 574dffb into spring-projects:master Apr 23, 2019
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) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants