使用编译时编织的Spring @Configurable的启动性能
这是关于堆栈溢出的第一个问题,所以请善待。
我正在运行一个应用程序
春天2.5.x
可配置的注释
编译时间编织(CTW)
行家
蚀/ AJDT
我使用CTW,一切运行正常。但是,如果我第一次实例化一个带注释的类,则需要很长时间。第二次非常快。
查看第一次调用的探查器堆栈跟踪,我看到93%的时间被使用
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(方法)
在第二次调用的堆栈跟踪中,此方法仅使用1%的时间。更糟糕的是:第一次通话大约需要第二次通话的10倍。
我想知道,因为我认为CTW不再需要织布工。
但是,只要有人在这个类上调用new,它就会开始分析原型bean。它使用aspectj weaver来分析需要完成的工作,并为下一次调用加速此过程做好准备。
有没有人有加快初始化注释类的第一次调用的经验?
这是我的pom片段:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-compile</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<configuration>
<verbose>true</verbose>
<complianceLevel>1.5</complianceLevel>
<source>1.5</source>
<showWeaveInfo>true</showWeaveInfo>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
没有找到相关结果
已邀请:
2 个回复
篮肥炼皖
乏摩纶誊伟