Note that there are some explanatory texts on larger screens.

plurals
  1. POStartup performance of Spring @Configurable with Compile Time Weaving
    primarykey
    data
    text
    <p>this is my first question on stack overflow, so please be kind.</p> <p>i am running an app with</p> <ul> <li>spring 2.5.x</li> <li>Configurable Annotations</li> <li>Compile time weaving (CTW)</li> <li>maven</li> <li>eclipse/ajdt</li> </ul> <p>I use CTW and everything runs fine. But if i instantiate an annotated class for the first time it takes very long. the second time it is very fast.</p> <p>Looking at the profiler stack trace for the first call i saw 93% of the time is used by org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(Method)</p> <p>In the stack trace of the second call only 1% of the time is used in this method. Even worse: first call takes about 10 times as long as the second call.</p> <p>I was wondering as i thought a weaver is no longer needed with CTW. </p> <p>But it seems that Spring starts analyzing the prototyped bean only as soon as someone calls new on this class. It uses aspectj weaver to analyze what needs to be done and prepares itself to speed up this process for the next call.</p> <p>Does anybody has any experience with speeding up the first call of initializing an annotated class? </p> <p>this is a snippet of my pom:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;goals&gt; &lt;goal&gt;test-compile&lt;/goal&gt; &lt;goal&gt;compile&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.aspectj&lt;/groupId&gt; &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt; &lt;version&gt;1.6.1&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;configuration&gt; &lt;verbose&gt;true&lt;/verbose&gt; &lt;complianceLevel&gt;1.5&lt;/complianceLevel&gt; &lt;source&gt;1.5&lt;/source&gt; &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt; &lt;outxml&gt;true&lt;/outxml&gt; &lt;aspectLibraries&gt; &lt;aspectLibrary&gt; &lt;groupId&gt;org.springframework&lt;/groupId&gt; &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt; &lt;/aspectLibrary&gt; &lt;/aspectLibraries&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload