Is it possible? Probably not until recently. Many large companies have been investigating migrating to other programming languages to boost their operation performance and save on server prices but there is no need really. Python can be right tool for the job and there is a lot of work around performance in the community happening. CPython 3.6 boosted overall interpreter performance with new dictionary implementation, CPython 3.7 is gonna be even faster thanks to introducing faster call convention and dictionary lookup caches. For number crunching tasks you can use PyPy with its just-in-time code compilation. Since recently it can run NumPy test suite and improved overall compatibility with C extensions drastically. Later this year PyPy is expected to reach Python 3.5 conformance.
All this great work inspired me to innovate in one of the areas which Python is used extensively, web and micro-services development.
At the PyGrunn 2016 conference last Friday I gave a talk about the Python cffi package and how to leverage it to embed PyPy into a C application. A video of this talk will be published later when it becomes available.
With the release of cffi 1.5.0 and its subsequent inclusion in PyPy 5 it becomes possible to embed PyPy. This is done by compiling the Python code into a dynamic library which can then be used in any other language. In this article I will show you how to do this.
“After FriendFeed was acquired several years ago, Tornado stagnated a bit, but this past year the community has been hard at work. Version 2.0 came out this past June, and the framework is now at 2.4.1 (at the time of this writing).
Unlike Gevent, Tornado works on PyPy, making it possible to compare PyPy vs. CPython in terms of nonblocking sockets. While I was at it (famous last words), I also experimented with Cython to see if just compiling a few key modules would give a comparable performance boost to running the entire app under PyPy…”