Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Performance Question

bparkoff
Beginner
324 Views
I tried to use Intel C++ Compiler 8.1. I am surprised that it is running much faster than Microsoft C/C++ Compiler and other third party C/C++ Compiler what I expect.
Intel C/C++ Compiler has an ability to inline most functions. It is very interesting so it can no longer use push/pop instructions by increasing performance.
Please state your opinion. Please answer three questions.
Is Intel C++ Compiler 8.1 the best choice for my Emulator Project? I concentrate to study emulated instructions to Pentium 4 family which timing is very critical. I expect to reduce Pentium 4 instructions by removing extra un-needed instructions before it increases the performance. Emulator Project may be able to run at fair speed.
Is writing assembly language using MASM 6.15 wasting a lot of time? It may run slow or fast on Pentium 4, but it may run slower on future Pentium processors. Intel C++ Compiler 8.1 is the best choice to reoptimize on Pentium III, Pentium IV, and future Pentium processors while C++ source code is always unmodified.
I would like to have a training from Intel so I can study by writing better C++ source code to support and increase better peformance than before. Where do I get best training including textbooks? I don't see any institute campus offer, but Intel does.
It is all what I am asking. I appreciate your support by providing the information so I can continue feedback my comment to Intel about Intel C++ Compiler.
Bryan Parkoff
0 Kudos
3 Replies
Intel_C_Intel
Employee
324 Views

Dear Bryan,

Using the Intel compilers for processor-specific optimization is probably your best choice since, like you said, it allows you to keep clear-to-read C++ sources. The Intel compilers can be expected to optimize for all processors released in the future, whereas inline assembly ultimately will become obsolete. As for documentation, allow me to point to
The Software Vectorization Handbook
(see
http://www.intel.com/intelpress/sum_vmmx.htm), which contains a detailed description of SSE/SSE2/SSE3, the compiler methodology used to exploit these extensions, as well as programming guidelines that may improve the effectiveness of automatic vectorization while keeping your sources clean and portable. You may also want to browse for other books at Intel Press (see http:://www.intel.com/intelpress/), or visit
"
The Intel Technical Optimization Center"
(see
http://appzone.intel.com/literature/index.asp) for the latest technical information on Intels products, including optimization manuals.

Hope this helps.

Aart Bik
http://www.aartbik.com/

Message Edited by abik on 06-03-2005 12:12 PM

0 Kudos
bparkoff
Beginner
324 Views
Aart Bik,
Thank you very much for the information. I will take a look at this website for more information about manual and training. I agree that inline assemble function such as __asm is already obsolete on Microsoft Visual Studio .NET 2005 or later version. I am sure that many assembly programmers are very disappointed and I am sure that Intel encourages them to use Intel C++ Compiler to test the performance.
I can tell that sometimes Intel C++ Compiler does its best to select some instructions for best optimization however it may do a fair job for fair performance.
For example, Intel C++ Compiler select 20 instructions inside one function that it runs 1,000,000 times for 200 ms. If I use __asm function, I would select 10 instructions and delete un-needed 10 instructions so it can run 1,000,000 times for 125 ms.
You may realize that __asm function is little faster than Intel C++ Compiler's performance.
Please state your opinion. Do you think that 125 ms using __asm function is not important? Do I always stick 200 ms using Intel C++ Compiler. I have Intel Xeon Pentium III 550MHz. Do you suggest that I purchase Intel Pentium IV 4.2GHz or later or Intel Xeon Pentium IV 4.2GHz?
It is all I have to ask and I will review website for manual and training. Thanks...
Bryan Parkoff
0 Kudos
Intel_C_Intel
Employee
324 Views

Dear Bryan,

If assembly yields much better performance in a function that is critical to your application, then, yes, of course I think that is important. That is why compilers provide the inline-assembly feature after all. However, I always try to encourage our customers toimprove performance at source code level first, possibly supplemented with the appropriate compiler hints and switches. All too often, source code that could have been optimized very well with only minor modifications is written into non-portable and obscure assembly just because the programmer was not willing to invest alittle more time in getting to know the compiler better (for reasons unknown to me, investing huge amounts of time coding assembly never seems a problem). As a last resort, however, inline-assembly provides possibly the best way to get high performance.

By the way, I you believe the compiler should have generated code similar to your 125ms solution, please feel free to report this to Premium Support as a performance feature request.

Aart Bik
http://www.aartbik.com/

PS. I should probably clarify that my obsolete was intended to refer to a particular instance of inline assembly (viz. a routine optimized with inline assembly for Pentium with MMX ultimately becomes obsolete), not to the concept of inline assembly itself (which, I believe, is here to stay).

Message Edited by abik on 06-03-2005 03:46 PM

0 Kudos
Reply