[pypy-issue] Issue #2980: awful bisect performance in pypy3 compared to cpython or pypy2 (pypy/pypy)

AliReza Mosajjal issues-reply at bitbucket.org
Tue Mar 26 02:48:30 EDT 2019


New issue 2980: awful bisect performance in pypy3 compared to cpython or pypy2
https://bitbucket.org/pypy/pypy/issues/2980/awful-bisect-performance-in-pypy3-compared

AliReza Mosajjal:

Hi. I created a simple code to search in IPs and filter out which one is from a certain country. Here's the code sample:

https://pastebin.com/NA3jpLei

to run it, I use this command (for testing):
```
shuf -i 16777216-4294967295 -n 1000000 |  python main.py
```
Now take a look at the output with different python versions:
```
shuf -i 16777216-4294967295 -n 1000000 | time pypy3 main.py
11.13user 0.05system 0:11.93elapsed 93%CPU (0avgtext+0avgdata 94676maxresident)k
```
```
shuf -i 16777216-4294967295 -n 1000000 | time pypy main.py
0.52user 0.06system 0:01.42elapsed 40%CPU (0avgtext+0avgdata 79356maxresident)k
```
```
shuf -i 16777216-4294967295 -n 1000000 | time python2 main.py
1.09user 0.00system 0:01.94elapsed 56%CPU (0avgtext+0avgdata 9504maxresident)k
```
```
shuf -i 16777216-4294967295 -n 1000000 | time python3 main.py
1.17user 0.01system 0:02.00elapsed 59%CPU (0avgtext+0avgdata 11380maxresident)k
```

What makes pypy3 slower (by a considerable magnitude) to other implementations?




More information about the pypy-issue mailing list