Open gitlab-importer opened 2 years ago
In Heptapod by @arigo on Feb 13, 2022, 07:45
Why should that slow down PyPy even more?
Unless I'm missing something, in the third case all the computations are involving longs. In the second case almost all iterations of the loop are done with machine integers. Maybe try to remove the last entry in bits
?
In Heptapod by @mattip on Feb 13, 2022, 08:21
The last entries do seem to influence the relative timings. Without the last three values in `bits', the ratio is more consistent
command line | time | relative to CPython |
---|---|---|
python3.8 /tmp/simple.py | 14ms | 1x |
pypy3.8-HEAD/bin/pypy --jit off /tmp/simple.py | 41ms | 2.9x |
--- | --- | --- |
python3.8 /tmp/simple.py sumup | 256ms | 1x |
python3.8 /tmp/simple.py sumup | 956ms | 3.7x |
--- | --- | --- |
python3.8 /tmp/simple.py suminv | 340ms | 1x |
python3.8 /tmp/simple.py suminv | 1250ms | 3.7x |
In Heptapod by @mattip on Feb 13, 2022, 07:40
Thinking about issue #3667, I was wondering how much slower is our base interpreter than CPython's interpreter. When comparing the code below to CPython, I get these results. Can we do better? The first is startup and import time, the difference between the second and third is that in the inner loop both an
__and__
and a__add__
are used. Why should that slow down PyPy even more?/tmp/simple.py