Skip to content

Improve AdvisedSupport.getAdvisors()#26017

Merged
jhoeller merged 1 commit intospring-projects:masterfrom
stsypanov:advised-sup
Nov 4, 2020
Merged

Improve AdvisedSupport.getAdvisors()#26017
jhoeller merged 1 commit intospring-projects:masterfrom
stsypanov:advised-sup

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.

3 participants