This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC is 7 times slower than Intel? How to optimize? Need help!!


//very simple array function calculation:
#include "math.h"
#include "time.h"
#include "stdio.h"

static double A[50000000];

int main(int argc, char *argv)
{
for (int t=0;t<50000000;t++) 
  A[t]=5.55*sin(t);   //random data

time_t time0 = clock();  

for (int t=0;t<50000000;t++)
  A[t]=exp(A[t]);    

printf("%g\n", ((double)(clock()-time0))/CLOCKS_PER_SEC);
}

Time for this code compiled with Intel10 compiler is 1.2sec.
Result for code compiled with GCC(v3 and v4) is 7.2sec.

I've tried all optimization options: -mfpmath=sse -msse2 -O3
-mtune=pentium-m
But still intel is 7 times faster.

-- 
View this message in context: http://www.nabble.com/GCC--is-7-times-slower-than-Intel--How-to-optimize---Need-help%21%21-tp19817010p19817010.html
Sent from the gcc - Help mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]