Mailinglist Archive: opensuse (4570 mails)
| < Previous | Next > |
Re: [SLE] Clearing up the FUD on CLI/Mono
- From: "Steven T. Hatton" <hattons@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 13 Nov 2005 01:45:55 +0000 (UTC)
- Message-id: <200511122045.38003.hattons@xxxxxxxxxxxxxxxxxx>
On Saturday 12 November 2005 07:34 pm, Randall R Schulz wrote:
> I'd think you'd not be given to folklore about program efficiency.
> Static compilation to native code as gcj (or conventional C++) does it
> is _not_ the best way to optimize performance. Java's so-called JIT
> (it's really on-demand) native code compilation has optimization
> opportunities not available when only static program analysis is
> possible.
I don't see how you can possibly achieve at runtime what a C++ compiler
achieves. First of all, you have to have the JVM running. That, in itself
is overhead. There is no Class object in C++. Templates don't exist at
runtime. You can write C++ in such away that you have very few pointers, and
thus very little indirection overhead. You simply cannot do that with Java.
What a good C++ compiler produces from well written code is extremely lean.
> For all practial purposes and for a sizeable majority of programs, Java
> is every bit as fast as C++ and what's more, the opportunities for
> optimization of C++ are more played-out than are those for Java, which
> is still improving its performance characteristics.
GCC 4's C++ compiler produces significantly faster compile code than previous
versions. The new move semantics will continue to offer improvements.
Furthermore, proper code design can have a profound impact on performance.
Steven
> I'd think you'd not be given to folklore about program efficiency.
> Static compilation to native code as gcj (or conventional C++) does it
> is _not_ the best way to optimize performance. Java's so-called JIT
> (it's really on-demand) native code compilation has optimization
> opportunities not available when only static program analysis is
> possible.
I don't see how you can possibly achieve at runtime what a C++ compiler
achieves. First of all, you have to have the JVM running. That, in itself
is overhead. There is no Class object in C++. Templates don't exist at
runtime. You can write C++ in such away that you have very few pointers, and
thus very little indirection overhead. You simply cannot do that with Java.
What a good C++ compiler produces from well written code is extremely lean.
> For all practial purposes and for a sizeable majority of programs, Java
> is every bit as fast as C++ and what's more, the opportunities for
> optimization of C++ are more played-out than are those for Java, which
> is still improving its performance characteristics.
GCC 4's C++ compiler produces significantly faster compile code than previous
versions. The new move semantics will continue to offer improvements.
Furthermore, proper code design can have a profound impact on performance.
Steven
| < Previous | Next > |