[pypy-issue] Issue #2782: extending bytearray is x30 slower than CPython (pypy/pypy)

Andrew Stepanov issues-reply at bitbucket.org
Mon Apr 2 08:23:13 EDT 2018


New issue 2782: extending bytearray is x30 slower than CPython
https://bitbucket.org/pypy/pypy/issues/2782/extending-bytearray-is-x30-slower-than

Andrew Stepanov:

The following code runs x30 slower on PyPy v5.10.1 (both 2 and 3) vs CPython
```python
b = b"\x01\x02" * 2500
x = bytearray()
for i in range(1000000):
    x.extend(b)
```
On my machine, it takes 0.55 sec to finish under CPython and 14.300 sec to finish under PyPy.




More information about the pypy-issue mailing list