有没有办法提高 Java 编译器的多核/多处理器性能? [英] Is there a way to improve multicore / multiprocessor performance of the Java compiler?

查看:28
本文介绍了有没有办法提高 Java 编译器的多核/多处理器性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的同事注意到当 javac 编译时它只使用一个内核.是否有类似于 Java 的 gcc 的 -j 命令允许我们在内核或处理器之间分配编译器工作负载?如果没有,您认为这是可能的,还是由于 Java 的设计而存在某种基本限制?

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?

环境是带有 Sun J2SE 1.6.0.11 jdk 的 Linux.

The environment is Linux with the Sun J2SE 1.6.0.11 jdk.

推荐答案

虽然不能完全回答您的问题,但一些构建环境如 ant 还支持构建的并行化,因此如果您的依赖关系图允许,您可以同时运行多个 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.

这篇关于有没有办法提高 Java 编译器的多核/多处理器性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆