Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cython: Compile Option -O3

How does one overwrite the default compile flags for Cython when building with distutils?

My question is similar to this , but the response involved manually running the cython steps - given the progress from 0.12 to 01.9 - is it possible for me to simplyy switch from -O to -O3?

Also have users seen a significant difference in speed depending on this switch?

I am on a windows machine.

like image 743
pythOnometrist Avatar asked Apr 29 '13 17:04

pythOnometrist


1 Answers

If you use a setup.py script you can set the "extra_compile_args" option (see https://stackoverflow.com/a/16402557/2355197). Depending on your code, you can see significant differences. For example, on GCC, -O3 enables the option "-finline-functions" which considers all functions for inlining.

Davide

like image 134
Davide Albanese Avatar answered Nov 05 '22 11:11

Davide Albanese