About programing, a general question

Michael Hennebry hennebry at web.cs.ndsu.nodak.edu
Thu Dec 23 17:36:39 UTC 2010


On Wed, 22 Dec 2010, David Liguori wrote:

> Not in terms of executable file size or speed of execution.  I took a
> course in high performance scientific computing.  An experiment we
> performed was to write a program for the sum of three huge arrays,
> repeated for larger and larger arrays, until it crashed, in C, C++,
> Fortran and Java.  The C won quite handily at least when the C++ program
> was one that would compile equally well in C.  The compiler was GCC in
> both cases, I don't know about the Fortran or Java (which is not,
> strictly speaking, a "compiled" language).

If you ran the same source compiled as C and as C++,
the results should have been pretty much the same.
There are some semantic differences,
but you won't find them by summing large arrays.
Apparently GNU's C++ front end isn't as good as its C front end.

-- 
Michael   hennebry at web.cs.ndsu.NoDak.edu
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."


More information about the users mailing list