Skip to content

avoid synchronization when AspectJExpressionPointcut.getShadowMatch hits cache [SPR-5668] #10339

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 Apr 12, 2009 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 12, 2009

Nikita Tovstoles opened SPR-5668 and commented

After we've added app-level cache to our app AspectJExpressionPointcut.getShadowMatch became a bottleneck on concurrent reads. In certain load tests, our system spends 6x more time blocked in getShadowMatch than in overall Runnable time. Happy to provide a JProfiler snapshot illustrating the problem (if needed).

Given that once an entry some targetMethod key is added to shadowMapCache it is never updated or evicted, there should be a way to avoid synchronization either altogether or when shadowMapCache returns a value on get. Please see the forum post for further details.


Affects: 2.5.6

Reference URL: http://forum.springsource.org/showthread.php?p=235994

Attachments:

Issue Links:

Referenced from: commits 56a4827

@spring-projects-issues
Copy link
Collaborator Author

Nikita Tovstoles commented

Attached JProfiler (v5.2.1) snapshot illustrating the problem

@spring-projects-issues
Copy link
Collaborator Author

Nikita Tovstoles commented

Please note that the following method is also a source of contention under load (and imo, similarly to the above, can be dealt with

LazySingletonAspectInstanceFactoryDecorator.getAspectInstance()

public synchronized Object getAspectInstance() {
     if (this.materialized == null) {
          this.materialized = this.maaif.getAspectInstance();
     }
     return this.materialized;
}

this.maaif isn't static, so I guess this static block is delaying the sole call to maaif.getAspectInstance().

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for pointing these out! I've addressed both for 3.0 M3.

Juergen

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

No branches or pull requests

2 participants