[Pyrex] Should Pyrex be in standard Python?

Arnd Zapletal a_zapletal at web.de
Fri Jan 23 22:59:30 CET 2004


On Fri, 23 Jan 2004 10:25:27 +0100
Joachim Saul <saul at gfz-potsdam.de> wrote:

> 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...

Oh, I do have -O2 as distutils' default. Anyway, as a pyrex-novice I'm curious and also performed some experiments: 
Pauls example of Fibonacci-numbers  (GCC) 3.2.2 20030222 (RedHat 9.0)

			pyrex		plain C	
no optim.		0m25.790s	0m18.180s			
-O			0m13.990s	0m13.370s
-O2			0m15.450s	 0m9.440s
-O3		 	 0m9.720s	 0m5.840s
-03 -funroll-loops	 0m7.430s	 0m4.730s

can anybody explain to me  what questionable (wrt pyrex) optimizations g++ includes when turning to -O2 (exec time increases!) Compare:

-O -funroll-loops -finline-functions -frename-registers  -fforce-mem
			 0m7.080s        0m7.310s

Or is there something pathological?

Arnd 




More information about the Pyrex mailing list