IntelliJ IDEA Aspectj(Ajc 编译器)在每次 Make 之后加载类需要花费太多时间
我想知道在 IntelliJ 中使用 Ajc 编译器时是否有办法减少编译时间。我有一个相当大的项目,我想使用 AspectJ,但不幸的是,当我尝试使用它时,我发现 Ajc 需要太多时间来加载所有类,并且每次我点击 Make 时它都会这样做(使用 Eclipse 模式插件保存 .java 文件)。所以每一个微小的变化都会导致 3 秒的类加载...... 有没有办法缩短这个时间?最好完全摆脱类加载。现在非常耗时,我不得不停止使用 Ajc 并切换回 Javac,与 Ajc 相比,Javac 几乎是即时的。 我正在使用 IntelliJ IDEA 10、AspectJ 1.6.11。不确定是否需要更多信息。
I wonder if there is a way to reduce compilation time when using Ajc compiler with IntelliJ. I have rather big project, i would like to use AspectJ with, but unfortunatly when I've tried to work with it i found out that it takes too much time for Ajc to load all classes and it is doing it every time i hit Make(save .java file with Eclipse Mode plugin). So every tiny change causes 3 second of class loading...
Is there a way to shorten this time? Preferably get rid of class loading at all. It is extremly time consuming as it is now and I had to stop using Ajc and switch back to Javac which is nearly instant compared to Ajc.
I am using IntelliJ IDEA 10, AspectJ 1.6.11. Not sure if more info is needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前 IDEA 使用类路径作为切面路径 - 这可以避免 UI 配置,但会导致较长的编译时间和增加的内存消耗。这在大型项目中尤其值得注意。
在 IDEA 11(从下一个 EAP 开始)中,aspectpath 将是可配置的。
At the moment IDEA uses a classpath as an aspectpath - this allows to avoid UI configuration, but causes long compilation time and increased memory consumption. This is especially notable on a big projects.
In IDEA 11 (starting from a next EAP) aspectpath will be configurable.
根据记录,IntelliJ v11 本来应该对 AJC 进行此修复,但他们发现了 AJC 增量编译的一个错误,因此他们在 v11 中完全关闭了增量编译 AJC,这显然使编译时间变得更糟。请参阅 http://youtrack.jetbrains.com/issue/IDEA-76479
For the record, IntelliJ v11 was supposed to have this fix for AJC in it, but they discovered a bug with incremental compilation for AJC so they've switched off incremental compilation AJC altogether in v11, which obviously makes compile time even worse. See http://youtrack.jetbrains.com/issue/IDEA-76479