First, let me announce the release of Pyston V2. Pyston V2 is a faster and highly compatible implementation of the Python programming language. In our macro tests, Pyston V2 was 20% faster than the original Python 3.8. More importantly, on your code, it can be faster. Pyston V2 reduces server costs, reduces user latency, and increases developer productivity.
Pystonv2 is very simple to deploy, so if you want better Python performance, we recommend that you spend five minutes trying Pyston. Using Pyston V2 is one of the easiest ways to speed up a project.
performance
Pystone V2 provides significant speed gains on many workloads with few drawbacks. Our focus has been on Web services workloads, but Pyston V2 also achieves higher speeds on other workloads and popular benchmarks.
Our team has put together a new public Python macro test suite that measures the performance of multiple commonly used Python projects. The benchmark scale in this suite is larger than in other Python suites and therefore more representative of real-world applications. Although this has led to our project not getting as much attention as other projects, we believe this test suite demonstrates that Pyston V2 can be speeded up better when faced with real use cases. Pyston V2 showed performance improvements in macro tests, running twice as fast as standard Python in tests such as chaos.py and nbody.py.
Here are the results of our performance test:
The above results were collected on an M5. large EC2 instance running Ubuntu 20.04.
Warm-up time is defined as the time before 95% of peak performance of the benchmark is achieved. If it cannot be distinguished from noise, it is denoted by n/ A. Our delay test considers only the behavior after warm-up.
Mypy and PyTorch do not support automatic building of C extensions from source code, so these Pyston test results use an unsafe compatibility mode.
The PyPy benchmark suite has been modified to run only Python 3.8 compatible benchmarks.
Results analysis
In our target benchmark (DjangoCMS + FlaskBlogging), the average latency for Pyston V2 improved by an average of 1.22 times and for P99 by an average of 1.18 times, while using only a few megabytes per process. We haven’t optimized the other benchmarks.
P99 latency refers to the 99th percentile of the response time distribution and is a common metric in Web services that can represent the average latency experienced by users. The high P99 latency of PyPy on DjangoCMS comes from periodic latency spikes, presumably due to garbage collection pauses. Both CPython and Pyston show periodic spikes, presumably due to their periodic collectors, but they are less frequent and less dramatic.
The Mypy and PyTorch benchmarks show the natural boundaries of Pyston V2. Most of these benchmarks are done in C extensions that are not affected by our Python acceleration. We support THE C API and have no emulation layer, so we can further improve mypy performance slightly without compromising pyTorch or Numpy performance. The exact benefits depend on the mix of Python and C extensions.
methods
The techniques we use in Pyston V2 include:
Use the DynASM JIT with very low overhead
Quickening
Regular CPython optimizations
Establish improvement process
compatibility
Since Pyston is a branch of CPython, we consider it to be one of the most compatible Python implementations. It supports all of CPython’s features as well as the C API.
Although in theory Pyston does the same thing, in practice any new Python implementation has more or less compatibility problems.
availability
Pystonv 2.0 is available immediately as a precompiled package. Currently, we offer packages for Ubuntu 18.04 and 20.04 x86_64. Zhengzhou which hospital to see vulva leukoplakia :mobile.120zybb.com/
A trial of Pyston simply involves installing the package, replacing PYTHon3 with Pyston3, and then reinstalling the dependencies with pip-Pyston3Install. If you have an automated build in place, you only need to change a few lines of code.