Re: Java or C++?



Gerry Quinn wrote:
> I have seen such claims for many languages, including Java. Perhaps
> you would provide a link to an unbiased set of benchmark tests that
> demonstrate it.

Fortran vs C on some array benchmarks is probably a good bet. Fortran
compilers often do a lot of platform-specific cache-based optimisation that
a C compiler won't do.

You may also be interested in my ray tracer:

http://www.ffconsultancy.com/free/ray_tracer/languages.html

> My impression is that C tends to score rather highly in performance
> benchmarks.

I wrote a C implementation of my ray tracer. It was a lot slower than the
C++. I am sure I could have optimised to run just as fast but it is
seriously tedious and boring work, even for this 50LOC program. The C was
already the longest implementation at about 200LOC.

So a more important point is that, if you have a non-trivial program,
there's no way you're going to be able to find the time to optimise the
whole thing by hand. You need a language expressive enough that its
compiler will generate efficient code for you. That language isn't C/C++.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: Performance Q: java hotspot vs. native code
    ... certain types of automatic optimisation possible which are impossible to apply ... Java" then yes you are right, but then you are discussing which language has come further along in their development of optimised code. ... are such that the compiler cannot perform automatic loop unrolling, ...
    (comp.lang.java.programmer)
  • Re: simple increment operator question.
    ... compiler to make optimasions right. ... optimisation ability will produce better code for ... I've never seen assember code for more than 15 years - ... language right when you have to write code in that language. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Resources for a Compilers course.....
    ... I am a compiler virgin but from all that I have heard about that book, ... tree, optimizing, or code generation, i. e. ... converting the AST into the target language, ... Synthesis (intermediate code generation, optimisation and code ...
    (comp.lang.scheme)
  • Re: Can you write code directly in CIL ???
    ... >>> Cab you write code directly in the Common Intermediate language? ... > best compiler translate this into assembly language. ... Did you actually run such benchmarks? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Flushes
    ... Isn't that more to do with the implementation of the compiler, ... the problem is actually in the language. ... The first rule of optimisation: ... The second rule of optimisation: "I told you, ...
    (rec.gambling.poker)