Source code online books for professionals by professionals


PyPy, Pyston, Parakeet, Psyco, and Unladen Swallow



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

PyPy, Pyston, Parakeet, Psyco, and Unladen Swallow. One of the least intrusive approaches to speeding up your code 
is to use a just-in-time (JIT) compiler. In the olden days, you could use Psyco together with your Python installation. 
After installing Psyco, you would simply import the psyco module and call psyco.full() to get a potentially quite 
noticeable speedup. Psyco would compile parts of your Python program into machine code while your program was 
running. Because it could watch what happens to your program at runtime, it could make optimizations that a static 
compiler could not. For example, a Python list can contain arbitrary values. If, however, Psyco noticed that a given list 
of yours only ever seems to contain integers, it could assume that this would be the case also in the future and compile 
that part of the code as if your list were an array of integers. Sadly, like several of the Python acceleration solutions, 
Psyco is, to quote its web site, “unmaintained and dead.” Its legacy lives on in PyPy, though.
PyPy is a more ambitious project: a reimplementation of Python in Python. This does not, of course, give a 
speedup directly, but the idea behind the platform is to put a lot of infrastructure in place for analyzing, optimizing, 
and translating code. Based on this framework, it is then possible to do JIT compilation (techniques used in Psyco 
are being ported to PyPy), or even translation to some high-performance language such as C. The core subset of 
Python used in implementing PyPy is called RPython (for restricted Python), and there are already tools for statically 
compiling this language into efficient machine code.
Unladen Swallow is also a JIT compiler for Python, in a way. More precisely, it’s a version of the Python 
interpreter that uses the so-called Low Level Virtual Machine (LLVM). The goal of the project has been a speedup 
factor of 5 compared to the standard interpreter. This target has not yet been reached, though, and the activity of the 
project seems to have stopped.
Pyston is a similar, more recent LLVM-based JIT compiler for Python being developed by Dropbox. At the time 
of writing, Pyston is still a young project, supporting only a subset of the language, and there is as yet no support 
for Python 3. However, it already beats the standard Python implementation in many cases and is under active 
development. Parakeet is also a rather young project, which, to quote the web page, “uses type inference, data parallel 
array operators, and a lot of black magic to make your code run faster.”

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   210   211   212   213   214   215   216   217   ...   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