32bit build out-performs 64bit build on mac os x

32bit build out-performs 64bit build on mac os x

I have noticed that our 32bit builds perform better than our 64bit builds on mac osx.I have built a test application and I am timing muliple calls to "ippsSub_32f".
The 64 bit build is almost twice as slow as the 32bit build of the exact same code.
Here is the output:
$ ./ippTest32Time Taken: 70.199000$ ./ippTest64Time Taken: 112.907000 Has anybody else noticed this?
Here are the build commands:
g++ -o ippTest32.o -c -03 -I/opt/intel/Compiler/11.1/080/Frameworks/ipp/Headers -m32 ipptest.cpp
g++ -o ippTest32 -L/opt/intel/Compiler/11.1/080/Frameworks/ipp/lib -lippiemerged -lippimerged -lippsemerged -lippsmerged /opt/intel/Compiler/11.1/080/Frameworks/ipp/lib/libippcore.a -m32 ippTest32.o
g++ -o ippTest64.o -c -03 -I/opt/intel/Compiler/11.1/080/Frameworks/ipp/Headers ipptest.cpp
g++ -o ippTest64 -L/opt/intel/Compiler/11.1/080/Frameworks/ipp/lib -lippiemerged -lippimerged -lippsemerged -lippsmerged /opt/intel/Compiler/11.1/080/Frameworks/ipp/lib/libippcore.a ippTest64.o

and the test code (the complete file is attached):

int main()


timeVal start, end, diff;

std::vector<float> in1,in2,out;




start = TimeNow();

for (int j=0;j<1000;++j) {



end = TimeNow();

diff = TimeDiff(end,start);

double diffMS = timeVal_to_Millisecs(diff);

printf("Time Taken: %f\\n",diffMS);

return 0;


Downloadtext/x-c++src ippTest.cpp1.05 KB
3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply


It looks that the code is linking with IPP statically, but it does to call ippInit() function.

This function is required by static linkage, or it will only use non optimized code.

Check here for more information:




Thanks Chao,
that has solved the performance issues with our application.Interestingly, for the test app included previously, adding ippInit() appears to slow down the 32bit performance (although this does not seem to be the case for our main application which uses a large range of IPP functions).The timings observed are as follows:

without ippInit()

32: Time Taken: 73.700000

64: Time Taken: 129.448000

with IppInit()

32: Time Taken: 107.572000

64: Time Taken: 105.004000

The processor being used is an Intel Core 2 Duo (2.4 Ghz)

Leave a Comment

Please sign in to add a comment. Not a member? Join today