Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Apr 12, 2009

    @spring-projects-issues
    CollaboratorAuthor

    Nikita Tovstoles commented

    Attached JProfiler (v5.2.1) snapshot illustrating the problem

  2. spring-projects-issues commented on Apr 16, 2009

    @spring-projects-issues
    CollaboratorAuthor

    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().

  3. spring-projects-issues commented on Apr 17, 2009

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

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

    Juergen

  4. added
    type: enhancement
    in: core
    on Jan 11, 2019
  5. added this to the 3.0 M3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions