Python Forum
Why does Cython generates bad code for Gentoo? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Why does Cython generates bad code for Gentoo? (/thread-23352.html)



Why does Cython generates bad code for Gentoo? - AlekseyPython - Dec-24-2019

Kubuntu 19.10 / Gentoo

I wrote a Python- program, that uses a small computational core, written with a Cython. Having tested on Kubuntu and Gentoo, I found that pure Python code (without a computational core) runs faster on a Gentoo (~+33%), but the Cython computational core runs about 1.5 times faster on a Kubuntu. As a result, the entire program runs faster on a Kubuntu.

I tried to transfer various combinations of options in a pyx- files:
# distutils: extra_compile_args = ["- O2", "-march = haswell", "-ftree-vectorize"]
, but this does not improve the speed of the Cython- code on a Gentoo.

How to speed up work of my program on a Gentoo?


RE: Why does Cython generates bad code for Gentoo? - AlekseyPython - Dec-26-2019

Moreover, adding the -O2 option improved the performance, but not enough (i.e. these settings affect the performance).