Java or C++

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

charrison

Lifer
Oct 13, 1999
17,033
1
81
C++ is the standard language.

Visual C++ is the c++ and microsofts added in classes for windows developement.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: manly
Originally posted by: charrison

Java does not protect from out of bound array indexes.
All Java array accesses are bounds checked. If an invalid index is used, it's the programmer's job to handle the error.
Java hides pointers from you, this in my opinion is a bad thing. Yes it was done as a security feature.
Why exactly is this a "bad" thing?
Java's implementation(ie interpreted) makes it slow, not its "protections".
Java JIT compilers have been around for a long time. Many credible benchmarks show that JVM execution for common instructions is within the same ballpark as native C++ runtimes. In other words, 90% of the time, Java runtime performance is more than good enough.




That is a total load of BS, java is soooo slow compared to c++ there are hundreds of studies like this that have exatcly the same results.
 

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
C++ is the standard language.

Visual C++ is the c++ and microsofts added in classes for windows developement.


I see, so would it be worth my while to learn Visual C++?
 

charrison

Lifer
Oct 13, 1999
17,033
1
81
Originally posted by: AznMaverick
C++ is the standard language.

Visual C++ is the c++ and microsofts added in classes for windows developement.


I see, so would it be worth my while to learn Visual C++?



Of course. Probably want to tackle c++ before jumping into the MFC stuff.
 

manly

Lifer
Jan 25, 2000
13,015
3,774
136
Originally posted by: Ameesh

That is a total load of BS, java is soooo slow compared to c++ there are hundreds of studies like this that have exatcly the same results.
I've only glanced through that article, but it appears to be 4 years old. It's hardly credible in my eyes. Keep spreading the FUD, MS troll. I'll put it to you this way; if Java JITed performance is inherently flawed, then the CLR would suffer similarly (even if not as poorly).

Just to be clear I'm not saying Java is as fast as C++, but that for most tasks it's within the same ballpark. Very conservatively, that would imply within an order of magnitude, but like I said there have been many benchmark comparisons done that show low-level performance between JITed Java and a C++ runtime to be fairly close (much closer than 10X to be precise).

In all fairness, I'll have to do some digging to corroborate the benchmark claims I made.
 

joohang

Lifer
Oct 22, 2000
12,340
1
0
Originally posted by: manly
Originally posted by: Ameesh

That is a total load of BS, java is soooo slow compared to c++ there are hundreds of studies like this that have exatcly the same results.
I've only glanced through that article, but it appears to be 4 years old. It's hardly credible in my eyes. Keep spreading the FUD, MS troll. I'll put it to you this way; if Java JITed performance is inherently flawed, then the CLR would suffer similarly (even if not as poorly).

Just to be clear I'm not saying Java is as fast as C++, but that for most tasks it's within the same ballpark. Very conservatively, that would imply within an order of magnitude, but like I said there have been many benchmark comparisons done that show low-level performance between JITed Java and a C++ runtime to be fairly close (much closer than 10X to be precise).

In all fairness, I'll have to do some digging to corroborate the benchmark claims I made.

Reminds me of the common misconception that VB = slow based on the judgements on the old P-code. VB6 came pretty darn close to C++, if I recall.
 

manly

Lifer
Jan 25, 2000
13,015
3,774
136
Here's another 4-year old comparison that shows JITed Sun JVM 1.1 is slower, *but* already competitive w/ C++. Page 4 is the table of benchmarks of low-level operations. Note the Java runtime is pre-Hotspot, which is generally considered to be a faster, higher-quality JVM implementation. The "Java is too slow" FUD is really old and worn out. The ancient article Ameesh referenced barely discusses JIT compilers towards the end as a new development.

Here's another comparison from the same time period that shows similar results. You can check out the Google query yourself.

Computer programmers have known for decades that interpreted programs are slower than compiled programs, so there's no need to repeat that old line. But guess what, neither Java or C# or VB6 is interpreted. Heck, I think even the scripting language Perl is JITed these days, I think.

So IMHO, I think charrison is simply wrong that Java is slow due to runtime interpretation. It's slower (but often good enough) because the runtime provides extra value that simply costs CPU cycles: bytecode verification, automatic memory management, dynamic code loading, etc. Java is by no means perfect but it's a good choice for many tasks; it also has some flaws that have yet to be ironed out.

Java performance does have some drawbacks (e.g. it's not the right choice for crypto or high-performance math), which I won't detail, but the main one that misleads some people is the JVM load time. Yes, this gives the appearance that application load-up is sluggish, but it does not affect the actual runtime performance. Even in that case, J2ME runs on tiny devices which shows Java is more versatile than many people think.

Lastly, the Java Hotspot VM is actually both JITed, and occasionally interpreted. JIT'ing bytecode is not a free process, so the theory goes that you shouldn't JIT the entire codebase the first time through, but rather you can JIT code on demand. Sun calls this mixed-mode, which contrasts with the CLR that specifies IL *must* be JITed. This is an implementation decision, as some JVMs do always JIT bytecode. Logically, I've read many CS people think the dynamic approach is just as good as the static always JIT approach.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |