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 <gaf@xxxxxxx>
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
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux