C ++ 11(本地代码)和Java(字节码) [英] C++11(native code) vs Java(bytecode)
问题描述
最近我一直在思考关于本地和字节码的区别。
我做了一些研究,我读到的所有信息是关于C ++代码编译成本机代码VS Java代码编译成字节码(运行在JVM,利用多核处理器)。结论是用Java编写的应用程序运行得更快。
Lately I've been thinking about the difference about native and bytecode. I did some research and all information I've read was about C++ code compiled into native code vs Java code compiled into bytecode(runs on JVM which takes advantage of multi-core processors). The conclusion was that applications written in Java run faster.
C ++ 11改变了这一点吗?
使用C ++ 11编写的应用程序(自添加线程)的运行速度比Java快吗?
Does C++11 change this? Does applications written in C++11(since adds threads) run faster than Java ones?
推荐答案
结论是用Java编写的应用程序运行得更快。
The conclusion was that applications written in Java run faster.
这是一个大的飞跃。有很多因素有助于系统的性能,很难说一种方法总是比另一种方法更好或更快。
That's a big leap to come to. There are so many factors which contribute to the performance of a system that it's very hard to say one approach will always be better or even faster than another.
C ++一直能够使用线程,它只是没有那么多的细节,如何使用它们。我不相信C ++ 11是关于性能,但标准化的事情,如内存模型。
C++ has always been able to use threads, it just didn't have as much detail on how they could be used. I don't believe C++11 is about performance but standardising things like memory models.
IMHO给定任何时间和专家开发人员,一个C ++程序将永远比Java程序快。然而,考虑到有限的时间和开发人员的混合能力,你更有可能得到一些工作和在Java中表现良好。你的里程会有所不同。 ;)
IMHO Given any amount of time and expert developers, a C++ program will always be faster than a Java program. However, given a limited amount of time and developers of mixed ability you are more likely to get something working and performing well in Java. Your mileage will vary. ;)
让我的答案更清楚...
Making my answer clearer...
C ++ 11改变了这一点吗?
Does C++11 change this?
否。我不同意这种情况也不会改变它。
No. I don't agree it is the situation nor does it change it.
用C ++ 11编写的应用程序运行速度比Java快
Does applications written in C++11(since adds threads) run faster than Java ones
是,但不是始终,与早期版本一样。
Yes, but not always, Just like earlier versions.
这篇关于C ++ 11(本地代码)和Java(字节码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!