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

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

问题描述

我的同事注意到,当javac正在编译时,它只使用一个核心。是否有类似-j命令与Java的gcc,这将允许我们跨核心或处理器分配编译器工作负载?如果没有,你是否认为这将是可能的,或者由于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的Linux 1.6.0.11 jdk。

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天全站免登陆