<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=snicoll" rel="nofollow">Stéphane Nicoll</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7630?redirect=false" rel="nofollow">SPR-7630</a></strong> and commented</p>
<p dir="auto">While migrating our app from 2.5.7 to 3.0.4 we have noticed a major slowdown in the application context's startup.</p>
<p dir="auto">Our application is using Spring Batch and has 22 batches. I have ran a profiling session and noticed an <em>abusive</em> call to <code class="notranslate">java.lang.Class.getMethod(String, Class[])</code>.</p>
<p dir="auto">The culprit seems to be a change in <code class="notranslate">AnnotationUtils.findAnnotation(Method,Class)</code>.</p>
<p dir="auto">Attached the back trace calls for both Spring 2.5 and 3.0.4. The only thing that changed between the profiling sessions is the Spring version and the profiler only starts the (same) application context.</p>
<p dir="auto">I also have the yourkit snapshots if you are interested to run a snapshot comparison.</p>
<p dir="auto">This is obviously blocking us to upgrade. Let me know if there anything I can do to help.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.4</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?p=323388#post323388" rel="nofollow">http://forum.springsource.org/showthread.php?p=323388#post323388</a></p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17185/spring25-batch-register-step-listeners-call-stack.png" rel="nofollow">spring25-batch-register-step-listeners-call-stack.png</a> (<em>108.12 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17178/spring25-getMethod.png" rel="nofollow">spring25-getMethod.png</a> (<em>19.30 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17186/spring25-register-item-listeners-call-stack.png" rel="nofollow">spring25-register-item-listeners-call-stack.png</a> (<em>91.53 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17187/spring-3.0.4.xls" rel="nofollow">spring-3.0.4.xls</a> (<em>594.00 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17198/spring-3.0.5-SNAP-getMethod.PNG" rel="nofollow">spring-3.0.5-SNAP-getMethod.PNG</a> (<em>16.06 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17197/spring-3.0.5-SNAP-register-item-listeners-call-stack.png" rel="nofollow">spring-3.0.5-SNAP-register-item-listeners-call-stack.png</a> (<em>46.23 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17177/spring3-getMethod.png" rel="nofollow">spring3-getMethod.png</a> (<em>59.53 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17183/spring3-register-item-listeners-call-stack.png" rel="nofollow">spring3-register-item-listeners-call-stack.png</a> (<em>67.84 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/17184/spring3-register-step-listeners-call-stack.png" rel="nofollow">spring3-register-step-listeners-call-stack.png</a> (<em>66.47 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398169037" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16501" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16501/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16501">#16501</a> ReflectionUtils slow down application startup on WebSphere</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398225601" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/21216" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/21216/hovercard" href="https://github.com/spring-projects/spring-framework/issues/21216">#21216</a> Comprehensively cache annotated methods for interfaces and superclasses</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/3c067e5db6309964d33b14924afbba039ad7e62b/hovercard" href="https://github.com/spring-projects/spring-framework/commit/3c067e5db6309964d33b14924afbba039ad7e62b"><tt>3c067e5</tt></a></p>
<p dir="auto">1 votes, 5 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=olivergierke" rel="nofollow">Oliver Drotbohm</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8880?redirect=false" rel="nofollow">SPR-8880</a></strong> and commented</p>
<p dir="auto">Suppose you have an application with a base package of <code class="notranslate">com.acme</code> with an <code class="notranslate">@Configuration</code> class located in this package. Now suppose you use this configuration class as <code class="notranslate">basePackageClass</code> inside <code class="notranslate">@ComponentScan</code>. This will result in an exception saying the class is registered twice. So you pretty much end up with always adding this exclude.</p>
<p dir="auto">Would it make sense to default the <code class="notranslate">excludeFilters</code> attribute of the <code class="notranslate">@ComponentScan</code> annotation as follows?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Filter(type = FilterType.ANNOTATION, value = Configuration.class)"><pre class="notranslate"><code class="notranslate">@Filter(type = FilterType.ANNOTATION, value = Configuration.class)
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 RC2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398115308" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13450" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13450/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13450">#13450</a> Allow <code class="notranslate">@Configuration</code> classes to self-<code class="notranslate">@ComponentScan</code> (<em><strong>"duplicates"</strong></em>)</li>
</ul>