Python developers can expect faster implementations with the release of Pyston v2.2, while Facebook is developing its own internal implementation called Cinder from which it aims to improve CPython upstream.
As one of the most popular programming languages, Python is especially widely used in applications such as data science and machine learning projects. However, he was criticized for his less than stellar performances, which led to efforts to inject more bubbly into him.
Pyston is one such project, and the freshly released version 2.2 is claimed to be 30% faster than standard Python in the Pyston team’s own web server benchmarks. Pyston is a fork of CPython, and the core technology that powers Pyston v2.2 is the same as found in previous versions, but the project team says they have tuned and optimized more areas and found ways additional to improve performance, especially in the JIT. and attribute caching mechanisms.
One of the ways the team found to get a bit more performance is to remove many rarely used debugging features supported by Python, as they are expensive (i.e. time consuming) when they are not needed. Doing exactly that resulted in a two percent speedup. Developers who want debugging functionality can apparently still use the stock Python “debug build”, due to compatibility between the two.
The Pyston project got off to a shaky start, with development halted after Dropbox withdrew its sponsorship in 2017. Now, feedback from potential customers has convinced the project team that Pyston can thrive on an open-source business model, and so the code for Python v2.2 is available on GitHub.
Meanwhile, the Facebook Incubator page on GitHub has a new project called Ash. This is described as Instagram’s internal performance-oriented production release of CPython 3.8, and the ultimate goal is to upstream any changes that improve performance to CPython.
So, the Cinder project team warns that even though they are running Cinder in production, they are not providing any support to anyone running it externally. It is, however, publicly available for anyone to download and try to suggest improvements.
Cinder contains a number of performance optimizations, including inline bytecode caching, early evaluation of coroutines, one JIT method at a time, and an experimental bytecode compiler that uses type annotations to emit bytecode specialized by type that works best in JIT.