Source code online books for professionals by professionals


Pyrex, Cython, Numba, and Shedskin



Download 4,67 Mb.
Pdf ko'rish
bet216/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   212   213   214   215   216   217   218   219   ...   266
Bog'liq
2 5296731884800181221

Pyrex, Cython, Numba, and Shedskin. These four projects let you translate Python code into C, C++ or LLVM code. 
Shedskin compiles plain Python code into C++, while Pyrex and Cython (which is a fork of Pyrex) primarily target C. 
In Cython (and Pyrex, its predecessor), you can add optional type declarations to your code, stating that  
a variable is (and will always be) an integer, for example. In Cython, there is also interoperability support for NumPy 
arrays, letting you write low-level code that accesses the array contents efficiently. I have used this in my own code, 
achieving speedup factors of up to 300–400 for suitable code. The code that is generated by Pyrex and Cython can be 
compiled directly to an extension module that can be imported into Python. If you want to generate C code from your 
Python, Cython is a safe bet. If you’re just looking for the speedup, particularly for array-oriented and math-heavy 
code, you should look into Numba, which generates LLVM code at import time. With the premium features available 
in NumbaPro, there’s even GPU support.

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   212   213   214   215   216   217   218   219   ...   266




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish