开发者

Will performance of compilation be severely affected by a very large number of jars/classes in the class path?

开发者 https://www.devze.com 2023-03-16 06:31 出处:网络
I am programatically using the Apache Ant API for compiling a large number of .java files. The classpath has a very large number of JARS and several thousand .class files.

I am programatically using the Apache Ant API for compiling a large number of .java files. The classpath has a very large number of JARS and several thousand .class files.

The performance is much lower than expected. Can the large classpath be responsible for this, or should I be 开发者_如何学Pythonlooking at other factors?


The short answer is you need to check how much free memory you have after a build. If it is low then your disk will have been working much harder than it would if everything where in memory.

The greatest bottleneck when performing a build is usually disk access. Having lots of jars can increase the amount of work you need to do but it make about as much difference than adding another class to compile.

When you system can keep all the files it needs in disk cache, your build will be much faster. Once you start having to go to disk to get these files it can run much slower.

Running more applications at the save time can reduce your free memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消