Java – What are the bottlenecks for the Java build speed

compilerjavaspeed

Which underlying system parameters have most influence on how fast a typical Java project (say dozens of classes and dependencies) builds?

There is a lot information on JIT (bytecode to CPU instructions) compiler optimization, but what if you need a large project to compile (very) fast? Say, 10 times faster? 100 times faster?

Best Answer

As in all "how do I make X faster" questions, your first approach should be to profile the process. IME the biggest bottleneck is usually the disk speed. With SSDs becoming ubiquitous, this may shift around a bit (network speed can be an issue if you're reading/writing to a remote machine, memory pressure can limit the amount of parallelism you can use, etc). If nothing else, for a first approximation I'd launch some kind of system monitor that displays CPU, disk, network and memory usage, then kick off a build. This should give you some idea.

Related Topic