Python Forum
Why does Cython generates bad code for Gentoo?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does Cython generates bad code for Gentoo?
#1
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?
Reply
#2
Moreover, adding the -O2 option improved the performance, but not enough (i.e. these settings affect the performance).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 918 Feb-15-2023, 05:34 PM
Last Post: zsousa
  I need to add data types to cython conversion python to c Good_AI_User 1 973 Aug-19-2022, 07:52 AM
Last Post: Gribouillis
  unable to load an image with C (Cython) HLD202 0 1,280 Jan-13-2022, 09:16 PM
Last Post: HLD202
  Cython np.where slows down the code Johanoosterwaal 1 1,695 Sep-01-2021, 07:33 AM
Last Post: Johanoosterwaal
  How can I use Cython to protect my Python Code? TurboC 2 4,079 Dec-03-2020, 10:37 AM
Last Post: padma121
  How I can speed up my Cython module? AlekseyPython 0 1,668 Oct-26-2019, 01:23 PM
Last Post: AlekseyPython
  Error in compiling cython extension on Python 3.6.4 on Windows 8 goldenmean 3 5,695 Jun-05-2019, 09:37 PM
Last Post: Larz60+
  cython does not work skorost5 5 4,183 Dec-19-2018, 09:23 AM
Last Post: skorost5
  Help with building Cython modules. jarrod0987 2 3,289 Nov-15-2018, 03:57 AM
Last Post: Larz60+
  Help with Cython in Win 10 jarrod0987 0 2,988 Oct-06-2018, 12:16 PM
Last Post: jarrod0987

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020