Questions tagged [pypy]

PyPy is an implementation of the Python language. Do not confuse with PyPI, the package index. General Python questions should just be tagged with python.

PyPy is a fast, very compliant, self-hosting implementation of the Python language. PyPy started out being a Python interpreter written in the Python language itself. It is built using the language.

PyPy has several advantages and distinctive features, including:

  • Speed: thanks to its Just-in-Time (JIT) compiler, Python programs often run faster on PyPy.

  • Sandboxing: PyPy provides the ability to run untrusted code in a fully secure way.

  • Stackless: PyPy can be configured to run in stackless mode, providing micro-threads for massive concurrency.

Programmers interested in following PyPy's progress should check the Dev Site and the PyPy Status Blog. For background, see PyPy - Goals and Architecture Overview.

Releases and builds

At this time there are three PyPy release series with binaries for x86, ARM, and PPC, on Linux, Mac OS/X and Windows:

  • PyPy2.7 v5.6.0 (the Python2.7 compatible release)
  • PyPy3.3 v5.5.0 (the Python3.3 compatible release)
  • PyPy-STM v2.5.1 (Linux x86-64 only)

More informations about builds and versions on download page. There are also nightly builds available.

794 questions
7
votes
2 answers

Why does JIT'ed code consume so much more memory than either compiled or interpreted code?

Compiled code such as C consumes little memory. Interpreted code such as Python consumes more memory, which is understandable. With JIT, a program is (selectively) compiled into machine code at run time. So shouldn't the memory consumption of a…
Continuation
  • 12,722
  • 20
  • 82
  • 106
7
votes
3 answers

Occur "Could NOT find Arrow" error when using pip_pypy3 to install pyarrow

I am trying to use pypy3 to install pyarrow, but some errors occur. Basic information is blow: macOS 10.15.7 Xcode 12.3 python version 3.7.9 pypy3 version 7.3.3 pyarrow version 0.17.1 cmd is 'pip_pypy3 install pyarrow==0.17.1' Some key information…
Long.zhao
  • 1,085
  • 2
  • 11
  • 16
7
votes
2 answers

PyPy 17x faster than Python. Can Python be sped up?

Solving a recent Advent of Code problem, I found my default Python was ~40x slower than PyPy. I was able to get that down to about 17x with this code by limiting calls to len and limiting global lookups by running it in a function. Right now, e.py…
llimllib
  • 3,642
  • 1
  • 29
  • 29
7
votes
2 answers

In Python how do I test if the interpreter is running Pyston, Jython, CPython?

I would like to test from inside a running Python program if the interpreter is running pyston, jython, ironpython, pypy and so on. The things that come to mind are pattern matching on system.version and checking the magic number from…
rocky
  • 7,226
  • 3
  • 33
  • 74
7
votes
1 answer

PyPy large memory usage compared to CPython

I used python to solve SPOJ's large input test problem and met with a very strange occurrence. I submitted the same code using PyPy and Python 2. The results are shown below: The code ran much faster using PyPy compared to CPython, as expected.…
Donald
  • 1,300
  • 2
  • 13
  • 29
7
votes
1 answer

PyPy: Severe performance penalty when using None in a list with integers

Because an algorithm I want to implement uses indices 1..n and because it's very error prone to shift every index by one, I decided to get smart and inserted a dummy element in the beginning of every list, so I can use original formulas from the…
ead
  • 32,758
  • 6
  • 90
  • 153
7
votes
1 answer

python vs java for kafka implementation

@kafka users: I have been trying to understand python client for kafka, including PyPy client as well. Following was a good benchmarking i read and realized some similar results: http://mrafayaleem.com/2016/03/31/apache-kafka-producer-benchmarks/ I…
Omkar
  • 2,274
  • 6
  • 21
  • 34
7
votes
1 answer

is there any alternative to sys.getsizeof() in PyPy?

I am trying to run a Python (2.7) script with PyPy but I have encountered the following error: TypeError: sys.getsizeof() is not implemented on PyPy. A memory profiler using this function is most likely to give results inconsistent with reality on…
alec_djinn
  • 10,104
  • 8
  • 46
  • 71
7
votes
1 answer

Where does tox search for PyPy / PyPy3 on Windows?

I'm using tox to run tests against different Python interpreters. tox finds my insallations of CPython interpreters as they are in their default locations. However, when I download PyPy for Windows, it is an archive, not an installer. Where should I…
Amir Rachum
  • 76,817
  • 74
  • 166
  • 248
7
votes
2 answers

PyPy file append mode

I have code like this: f1 = open('file1', 'a') f2 = open('file1', 'a') f1.write('Test line 1\n') f2.write('Test line 2\n') f1.write('Test line 3\n') f2.write('Test line 4\n') When this code is run with standard Python 2.7 interpreter, the file…
7
votes
1 answer

What's the output during PyPy build means?

During the building phase of PyPy, the script produces some nice ASCII characters that looks really interesting. What does each character represent? How to interpret this output? What really is PyPy build doing while producing this ASCII art?
yegle
  • 5,795
  • 6
  • 39
  • 61
7
votes
1 answer

How to use PyPy on a Mac?

PyPy's speed promises make me want to try it. Unfortunately, none of the tutorials I read on the subject really helped me to understand the very basics, namely how to (in simple steps): Install PyPy on Mac Run a .py script I read that downloading,…
Lucien S.
  • 5,123
  • 10
  • 52
  • 88
7
votes
1 answer

Which PyPy memory profiler is recommended?

What tools can I use to monitor PyPy’s memory consumption? It’s better if the tool is portable for various Python interpreters (CPython and PyPy) and versions (2.6 to 3.3).
minhee
  • 5,688
  • 5
  • 43
  • 81
7
votes
2 answers

Tools for compiling Python / Boo / Ruby like syntax to C / C++ / LLVM / Javascript (using JS ArrayBuffer for speed)

I'm trying to automatically compile / convert code written with Pythonic semantics into native and fast Javascript code. What tools can do this, with nice debugging support possible like with Java etc? Has anyone done this? Why? I'm trying to write…
Luke Stanley
  • 1,274
  • 1
  • 16
  • 32
7
votes
2 answers

Unicode, regular expressions and PyPy

I wrote a program to add (limited) unicode support to Python regexes, and while it's working fine on CPython 2.5.2 it's not working on PyPy (1.5.0-alpha0 1.8.0, implementing Python 2.7.1 2.7.2), both running on Windows XP (Edit: as seen in the…
mgibsonbr
  • 21,755
  • 7
  • 70
  • 112