Skip to content

Improve AdvisedSupport.getAdvisors() #26017

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 1 commit into from
Nov 4, 2020

Conversation

stsypanov
Copy link
Contributor

In some scenarios AdvisedSupport.updateAdvisorArray() takes about 30% of AdvisedSupport.addAdvisor() (see attachment) and is pointless in fact, as the only place where we use advisorArray is AdvisedSupport.getAdvisors(). So we can rewrite the code to retrieve the array from the advisors list only when it is necessary instead of rewriting it on each addition or removal of advice.

This allows to simplify code and remove advisorArray. In order to reduce allocation rate I've also introduced AdvisedSupport.getAdvisorCount().

Screenshot from 2020-11-02 09-43-52

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 2, 2020
@jhoeller jhoeller self-assigned this Nov 2, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 2, 2020
@jhoeller jhoeller added this to the 5.3.1 milestone Nov 2, 2020
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.

None yet

3 participants