[Pyrex] Pyrex versus C

Paul Prescod paul at prescod.net
Sat Jan 24 02:55:52 CET 2004


Joachim Saul wrote:
> * Paul Prescod [2004-01-23 07:52]:
> 
>>bash-2.05a$ gcc cmodule.c
>>bash-2.05a$ time ./a.out
>>100000000:1900000000
>>real    2m15.950s
>>user    2m6.420s
>>sys     0m0.680s
> 
> 
> Try "gcc -O3", which will speed-up your C program by a factor of
> about 3 (in my test). Combined with "-funroll-loops" the factor
> becomes 4. Which compiler flags did you actually use for compiling
> your pyrexmodule.c? In fact, distutils does use the "-O3" flag...

Of course that's the difference! That would explain it. I had no idea 
that GCC's default optimization level generated such slow code.

  Paul Prescod





More information about the Pyrex mailing list