Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28619 Discussions

Win32- or x64-application, which one is faster?

chdthanh
Beginner
1,869 Views

Dear all,
I compile an application based on win32 and x64 and run on 64bit-win7. However, the win32-application runs faster than then x64-application. Is it normal?
What is advantages of x64-application over win32-application?x64-application can use more than 4GB memory when running, can't it?
Thank you in advance.
Thanh

0 Kudos
13 Replies
mecej4
Honored Contributor III
1,869 Views
There are reasons for an IA32 application to run faster: fewer address bytes to move around, and possibly fewer bytes for integer type variables to move from memory to registers.

There are reasons for an X64 application to run faster: more registers, which may eliminate some memory accesses; some operations involving large integers (e.g., RNGs and encryption algorithms) can be performed with fewer instructions.

There are instructions available with more recent processors that can yield performance improvements. Some of these may not be available with compilers that are not capable of generating code for these processors.

As a consequence, there can be no single answer to "..is it normal?" other than, if you like, "...it depends!".
0 Kudos
TimP
Honored Contributor III
1,869 Views
In addition to points made by mecej4:
ifort chooses shorter code for ia32 in some situations, not unrolled to optimize for large trip counts. Where this works as intended, the 32-bit code may be faster for loop trip counts of 40 or less. The -unroll0 option might speed up the 64-bit code for short loops.
ia32 and intel64 compilers may make different choices about splitting or fusing loops, or multi-versioning. You might see such differences reflected in -opt-report. You may have opportunities to control these with !dir$ distribute point directives.
There are a few long standing code generation issues where the 64-bit code is not as good (regardless of trip count). EOSHIFT is among the more glaring examples. If you can demonstrate such a case, you are welcome to submit a reproducer, e.g. on your premier account.
0 Kudos
chdthanh
Beginner
1,869 Views
Dear mecej4 and TimP:
Thank you very much for your explanations.

In addition, could you please point out why I have the following problem?

I compiled x64 application of an identical codeson two different 64bit-win7 computers, which are a notebook i5-2410M and a destop computeri7-2600. Note that I use the identical win, VS, compiler, MKL, options on both computer.

On the notebook, whensome subroutines are compiled there is remark LOOP WAS VECTERIZED. As a result, the application can run very fast (about 5 times faster)compared to 32-bit application. This is very great for my application.

However, on the destop computer, I did not see the remark LOOP WAS VECTERIZED while compiling. And then the application run as slow as 32-bit application.

Of course, the 64-bit application which is compiled on the notebook can run on the destop computeras fast as that running on the notebook.

Could you please explain what 'LOOP WAS VECTORIZED' means?
Anh how can Iset the compiler on destop computer to compile my code which can be run fast like that on the notebook?

Thank you in advance.
Thanh
0 Kudos
Steven_L_Intel1
Employee
1,869 Views
First of all, you seem to have an older compiler version, since that LOOP WAS VECTORIZED message hasn't been put out, by default, for a couple of years now. It means that the compiler found an opportunity to use SSE instructions to do multiple operations (such as multiply four elements of an array) in one instruction. If you are indeed using the same compiler version and the x64 compiler on both computers, then the results should be the same.

Please show us the buildlog.htm for both compiles. (I do not mean what VS puts to the Output pane, but the file in the Release subfolder of your project.) You are using a Release configuration on both PCs, yes?
0 Kudos
chdthanh
Beginner
1,869 Views

Hello Steve Lionel:

You are right. I am using compiler version 10.1.024 several years.

I indeed use same compilers on both computers because I have just installed both computers from64bit-win7 to VS2008 and IFor.

Notice that the computer running slowly I first installed VS2010 and then uninstalled and reinstalled VS2008. I wonder if it causes the difference or not?

I attach here the buildlog.htm created by both compilers, namely buildlog-fast and buildlog-slow.

I am sorry I can not understand what you mention about "a Release configuration". Could you pleaseexplain me about that?

Thank you in advance and I am looking forward to having your advices.
Regards,
Thanh

0 Kudos
TimP
Honored Contributor III
1,869 Views
The ifort 10.1 would have to run independently of VS2010. Possibly you set it up with the VS2005 subset.
Your build logs show that your slow case has /Od and other options such as you would get with the Debug choice in the GUI setup, which prevents the auto-vectorization and other optimizations.
0 Kudos
Steven_L_Intel1
Employee
1,869 Views
As Tim says, your "slow" configuration is unmodified Debug where the "fast" one has most of the debug options turned off. Use a Release configuration if you want fast. You would also find significant performance improvement by upgrading to compiler version 12.
0 Kudos
chdthanh
Beginner
1,869 Views
Hello TimP:
Thank you for your advices. I set debugging parameters in two compilers identically and got the same solving time.
Thanh
0 Kudos
chdthanh
Beginner
1,869 Views
Hello Steve:

What is "a Release configuration" which you mentioned?
How can I use a Release configuration?

I can not understand why debugging parameters influence solving time much? Do we have any useful guides for setting them? In my case, by changing Debug information format from FULL(/Zi) to None I can improve solving time greatly. However, with option None I can not run step by step to debug the codes.

I am using compiler 10, is upgrading to version 12free or not ?

Regards,
Thanh

0 Kudos
TimP
Honored Contributor III
1,869 Views
I don't understand your question, or whether you have read the previous answers or the build logs which you sent. If you want auto-vectorization, while retaining some of the debug options, you can over-ride the /Od by /O2, but you will lose some of the debug capability. Maybe if you think about the implications of /check:bounds you may begin to understand that it takes extra time as well.
If your license was issued at the time ifort 10 was active, it will have expired, and you will need a new license for ifort 12.
0 Kudos
Anonymous66
Valued Contributor I
1,869 Views

A release version of your project is designed to be run by the end user and has more optimizations turned on by default than the debug configuration in Visual Studio. In Visual Studio there is a drop down box in the top menu bar that tells you if you are in "debug" or "release" mode. If you are currently in debug mode and want to switch to a release configuration, click on this dropdown box and choose release mode.

Annalee

0 Kudos
Steven_L_Intel1
Employee
1,869 Views
Thanh,

In the top toolbar of Visual Studio is the configuration selector dropdown control. In your case, it will say "Debug". If you click on the control you can select Release. A Debug configration disables optimization - as Tim indicated, on your "Fast" system you manually changed the optimization level to "Maximize Speed", but on the "Slow" system you did not, leaving the optimization level "Disabled". A Debug configuration disables optimization for easier debugging.

If you want to debug, do it with optimization disabled and don't worry about timings.

As for upgrading to version 12, as Annalee says, this is not a free upgrade. If your license was relatively recent, you could buy a Support Service Renewal at a discount off the full price, but if your license is more than two years old, it is more cost-effective to buy a new license. Version 10 is no longer supported.
0 Kudos
chdthanh
Beginner
1,869 Views
Thank you very much for your useful answers. Now I am understading my situation. With debug and release modes, I can use optimal default setting to get what I need.
Regards,
Thanh
0 Kudos
Reply