- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Just get a question. Has anyone ever compared the performance of Intel C++ and Intel Fortran? This might be interesting, because I saw reports to compare Intel C++ to other C++ compiler and Intel Fortran to other Fortran compiler, but I never saw Intel C++ vs. Intel Fortran. I mean given the code with the same amount of computation, I have the interst to know which is faster or more accurate or etc.....
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This isn't usually a comparison people are interested in. Both compilers share the same code generator and optimizer, so any differences will be due to language semantics and any differences in how you write the code. It's hard to write a meaningful benchmark that does "the same amount of computation" in two different languages, though you can probably come close if you work at it. Most industry benchmarks are based on real applications and not artificial tests. (LINPACK is probably an exception.)
If you are trying to choose a language, choose it based on which one best meets your application needs, combined with your expertise with the languages and that of people who will maintain the code. Traditionally, it has been said that Fortran code tends to be faster than C code, but Intel C++ supports pragmas and options that can reduce or eliminate these differences (mainly due to aliasing rules.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Everyone who makes such comparisons has their own way of going about it. For some people, the point of C++ is abstraction without concern for performance. Likewise, many of the modern Fortran constructs don't get as much attention to optimization in the compilers.
Intel C++ (and also g++) support the restrict extension which allows equivalent optimization to Fortran where it's relevant. If your concept of purism disallows this, you will see a significant deficit in C++.
If I may editorialize, the efforts to support parallelism in C++ mostly go off in more non-standard directions than similar efforts for Fortran. The latest C++ compilers mostly have c++-0x extensions, some of which relate to performance, covering things which were already standardized in Fortran + OpenMP.
I have posted some benchmarks which make an effort to compare the potential performance of c, c++, and Fortran: http://sites.google.com/site/tprincesite/
The major advantage of C or C++, in the few cases where there is one, in these benchmarks, comes through the use of the IA "intrinsics."
My personal view of the subject is it is usually possible to achieve similar performance to Fortran in C++ through use of extensions, and in a few cases significantly greater performance with non-portable code, at a cost in programming effort, compared with Fortran. C++ proponents will disagree with this, discounting the significant effort required to employ C++, while regarding any efforts to understand Fortran as relevant only to the era prior to C++.
Some of the proponents of C or C++ justify their efforts on the basis of the slight additional effort or expense required to make a Fortran compiler available along with their favorite C++.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page