Cython:编译选项-O3

时间:2013-04-29 17:46:01

标签: gcc cython compiler-optimization

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

我的问题与此类似,但是响应涉及手动运行cython步骤 - 假设从0.12到01.9的进度 - 我是否可以简单地从-O切换到-O3?

还有用户看到速度的显着差异取决于此开关吗?

我在Windows机器上。

1 个答案:

答案 0 :(得分:7)

如果您使用setup.py脚本,则可以设置“extra_compile_args”选项(请参阅https://stackoverflow.com/a/16402557/2355197)。根据您的代码,您可以看到显着的差异。例如,在GCC上,-O3启用选项“-finline-functions” 考虑所有内联函数。

的Davide

相关问题