Re: About programing, a general question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 12/22/2010 12:20 PM, 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).
There is considerable more overhead in compiling a C++ program. I would
probably guess that FORTRAN would win. Another issue is optimization.
Optimization can make major differences. On some RISC platforms we not
only used compiler optimization, but also took the output from the
compiler and based upon some of the hardware latency specifications,
would reorder the resultant code. Today, many CPUs do this automatically.
In any case when writing any code, state your goals ahead of time. I
tend to like to write my code with an emphasis on readability and
correctness. Once the code is working, I can run a performance analysis
to see the places in the code things are slowing down.

Jerry Feldman <[email protected]>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846

Attachment: signature.asc
Description: OpenPGP digital signature

users mailing list
[email protected]
To unsubscribe or change subscription options:

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux