不指望你靠这段程序来告诉我JAVA比C或者C++快了。
今天俺撤了。
今天俺撤了。
解决方案 »
- java nio的selector 选择器里的通道有数量限制吗
- 杨辉三角编译通过但是!!
- java类能打包成.DLL吗?
- 请问,怎么才能直接调用outlook中的“新邮件”窗口,来发送邮件。如何直接将对方邮件地址传入。(比如网页上提供的该公司email发送)。
- 请问哪兄弟知道在东莞或广州的JAVA培训的地方
- Applet中添加PopMenu或是Dialog时为什么在底部总有“Java Applet Window”?如何去掉:
- 希望frame最小化时不在任务栏而在系统栏上,如何做?
- java中有没有计时器?
- 我在网上下在了一个java写的编辑器的程序,扩展名是jar,可以用winzip打开,请问如何能够运行呢?
- Object[] 如何转化为String[]?
- 黄昏(宣传版 诗歌)
- JTest问题,在线等待!!!
http://www.idiom.com/~zilla/Computer/javaCbench.htmlThe compiler knows what processor it is running on, and can generate code specifically for that processor。
JIT编译器知道什么处理器正在运行,可以产生对应此处理器的优化代码。在这一点上,C++的静态编译器肯定做不到。
//嗯,这样就是为每个处理器都要先预编译一下,只不过每次JAVA帮你做一次,而C++要手工做,对不同的处理器做优化,看看VC的链接选项就知道了,还有LINUX包后面的i386,i586,i686就知道了,而且我觉得他优化得不够,还可以手工汇编优化。
# The compiler knows what processor it is running on, and can generate code specifically for that processor. It knows whether (for example) the processor is a PIII or P4, if SSE2 is present, and how big the caches are. A pre-compiler on the other hand has to target the least-common-denominator processor, at least in the case of commercial software.# Because the compiler knows which classes are actually loaded and being called, it knows which methods can be de-virtualized and inlined. (Reably, modern java compilers also know how to "uncompile" inlined calls in the case where an overriding method is loaded after the JIT compilation happens.)
这个比较复杂,不好翻译,自己看吧
你觉得C++编译器做不到这点吗?你知道intel C++编译器现在能做得多好吗?# A dynamic compiler may also get the branch prediction hints right more often than a static compiler.
动态编译器可以进行更准确的分支预测,从而可以提前取入指令
你觉得C++编译器做不到这点吗?你知道intel C++编译器现在能做得多好吗?
将来你也许会是位高手,就冲这股执着精神,预先祝福你一下。