English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-03-08 19:57:33 · 10 answers · asked by chen j 1 in Computers & Internet Programming & Design

examples? benchmarks?

2007-03-08 20:00:48 · update #1

10 answers

All other things being equal (same hardware, OS, type of program) C++ is faster, as it compiles to directly into specific hardware binaries (Executable). Java always requires a JVM (a virtual computer) which takes the java op codes and converts them into the underlying hardware instructions. While some JVM's are clever and re-compile Java op codes, even with this the JVM's management structure (memory management such as garbage collection.) always will make it slower than a comparable C++ program. As empirical evidence to C and C++ performance , all production systems, especially those requiring high performance (Databases, graphics systems, video games) are almost exclusively written in C/C++

2007-03-08 20:14:56 · answer #1 · answered by acb29 4 · 0 0

C++ is 100-300% times faster than java

2007-03-09 04:48:17 · answer #2 · answered by Anonymous · 0 0

Although I am an avid Java Programmer. I would have to say
that C++ is Definitely faster. The reason Java is Multi-Platform is because of the jit (Just inTime Compiler (JRE)) that is written for each specific platform mac, pc, Linux etc. C++ is Platform specific. And does not have to go through a jit.

2007-03-09 07:28:35 · answer #3 · answered by Mike B 1 · 0 0

C++ of course. C is a compiled language while Java is more of an interpreted language.

When you code is compiled, your code is transformed into machine language (1's and 0's) which is ready to execute.

When your Java code is Built, it is just being transformed into an intermediate language. It's not yet ready to execute after building; you have to have an interpreter to transform it into machine code (i.e. Java Virtual Machine). This extra step makes it slower for Java. But has the advantage of being able to run in different machines and OS.

2007-03-09 04:19:26 · answer #4 · answered by sakuragi h 1 · 0 0

Depends on what you want to do with it but generally I'd think C++ would be faster but Java has more capabilities.

2007-03-15 17:59:05 · answer #5 · answered by Mike 2 · 0 0

"java is faster than C the majority of the tests"

2007-03-09 04:06:14 · answer #6 · answered by kifcaliph 1 · 0 1

I think c++ and java has it own advantages and disadvantages. And it would depend on the people on what he/she thinks easiest for him/her.

2007-03-09 06:52:43 · answer #7 · answered by Jenna 3 · 0 0

java is faster

2007-03-09 04:02:39 · answer #8 · answered by Anonymous · 0 1

c++

2007-03-09 03:59:05 · answer #9 · answered by wigginsray 7 · 0 0

windows...

2007-03-09 04:00:24 · answer #10 · answered by roy_marzoed 4 · 0 2

fedest.com, questions and answers