talira

A fast, compliant alternative implementation of Python

open sourceMITself-hostablefree

PyPy is an alternative implementation of Python with a just-in-time compiler, built in RPython, a language developed alongside it. On average PyPy 3.12 runs about four times faster than CPython 3.11, and memory-hungry programs can use less memory. Each release ships interpreters for Python 2.7, 3.11 and (in beta) 3.12 with their standard libraries, supports much of the CPython C API (so NumPy and scikit-learn run) and CFFI, and includes Stackless micro-threads and greenlets. It's fastest on long-running programs that spend their time in Python code. Binaries are available for Linux, macOS and Windows on x86-64 and ARM64, and it's MIT licensed.

Problems it solves

  • my long-running Python program is too slow and I don't want to rewrite it in another language
  • speed up pure Python code without changing it
  • a faster Python interpreter that still runs Django and my existing libraries
  • my Python service uses hundreds of megabytes of memory
  • run Python with lightweight micro-threads for massive concurrency
  • call C libraries from Python efficiently with CFFI

Features

  • just-in-time compiler
  • about 4x faster than CPython 3.11 on average
  • Python 2.7 and 3.11 interpreters, with 3.12 in beta
  • much of the CPython C API, so NumPy and scikit-learn run
  • CFFI support
  • Stackless micro-threads and greenlets
  • lower memory use for large programs
  • x86, ARM, AArch64, RISC-V, PowerPC and s390x

Limitations

  • Short-running processes don't speed up, because the JIT compiler needs a few seconds to warm up.1
  • Code that spends its time in C libraries rather than Python code doesn't get faster.1
  • Modules that use the CPython C API will probably work but don't get a JIT speedup.2
  • It doesn't support CPython's reference-counting semantics, so objects (such as open files) are released only when the garbage collector runs.2

Capabilities

Has a command line toolplan not known

What people say

  • Miðeind's founder and CEO says PyPy let them use Python for more of their toolset than CPython alone would have supported (Feb 2022). source

Alternatives

The same job

These do what PyPy does.

  1. TruffleRuby A high performance implementation of the Ruby programming language, built on GraalVM

Compare PyPy with the top 3