[pypy-issue] Issue #3167: PyPy3 performance regression in string join (pypy/pypy)

grambler1 issues-reply at bitbucket.org
Fri Feb 7 05:21:21 EST 2020


New issue 3167: PyPy3 performance regression in string join
https://bitbucket.org/pypy/pypy/issues/3167/pypy3-performance-regression-in-string

grambler1:

Hello. I recently experienced a regression in performance between PyPy3 and PyPy2 in the string join method.

The `testjoin.py` file is attached to the issue.  
In the following experiments `N = 10**5`

```
$ pypy3 testjoin.py
Benchmark:                           Time (s) (200 iterations)
' '.join(map(str, range(N)))         1.4801070280000204
' '.join(list(map(str, range(N))))   0.7104864799998722
' '.join(str(i) for i in range(N))   1.5713386769998579
' '.join([str(i) for i in range(N)]) 0.7061686919996646
```

```
pypy testjoin.py
Benchmark:                           Time (s) (200 iterations)
' '.join(map(str, range(N)))         0.537734985352
' '.join(map(str, xrange(N)))        0.670211076736
' '.join(list(map(str, range(N))))   0.549700975418
' '.join(str(i) for i in range(N))   1.45470499992
' '.join([str(i) for i in range(N)]) 0.542479991913
```

PyPy3 version:

```shell
$ pypy3 --version
Python 3.6.9 (7.3.0+dfsg-1~ppa1~ubuntu19.04, Dec 26 2019, 11:14:16)
[PyPy 7.3.0 with GCC 8.3.0]
```

PyPy2 version:

```shell
$ pypy --version
Python 2.7.13 (7.3.0+dfsg-1~ppa1~ubuntu19.04, Dec 26 2019, 11:10:50)
[PyPy 7.3.0 with GCC 8.3.0]
```

As indicated by the version information I ran the benchmarks on an Ubuntu system.

Is this a known regression?




More information about the pypy-issue mailing list