Monday, March 28, 2011

Is there a way to improve multicore / multiprocessor performance of the Java compiler?

My coworker noticed that when javac is compiling it only utilizes a single core. Is there anything like the -j command with the gcc for Java that will allow us to distribute the compiler workload across cores or processors? If not, do you think that this will ever be possible or is there some sort of fundamental restriction as a result of Java's design?

The environment is Linux with the Sun J2SE 1.6.0.11 jdk.

From stackoverflow
  • DataRush: http://www.pervasivedatarush.com/ may help you.

    Elijah : Does it come with its own implementation of the Java compiler? It isn't obvious from their site. That said - it looks like a cool tech that I want to look more into. Thanks!
    Amit : Its a Java library.
  • You may find this blog useful: http://blogs.sun.com/jjg/entry/towards_a_multi_threaded_javac

  • Although not exactly an answer to your question, some build environments like ant also support parallelization of builds, so if your dependency graph permits you can have multiple javac's running at the same time.

    Alex B : Regarding ant's parallel task: "It should be considered an advanced task which should be used in certain batch-processing or testing situations, rather than an easy trick to speed up build times on a multiway CPU" - http://ant.apache.org/manual/CoreTasks/parallel.html

0 comments:

Post a Comment