[pypy-issue] Issue #2791: PyPy3: use W_IntObject instead of W_LongObject whenever possible (pypy/pypy)
issues-reply at bitbucket.org
Fri Apr 6 12:41:58 EDT 2018
New issue 2791: PyPy3: use W_IntObject instead of W_LongObject whenever possible
In pypy3, we have 2 implementations for app-level int objects: W_IntObject and W_LongObject. The former is similar to Python 2 ints and JITs nicely, the latter wraps `rpython.rlib.rbigint` and is much slower.
Issue #2785 fixed one case where using W_LongObject instead of W_IntObject caused a major user-visible slowdown, but there are many more places where we create W_LongObject indiscriminately. It would probably make sense to always try to convert to W_IntObject. We should at least make `space.newlong == space.newlong_from_rarith_int == space.newint`.
More information about the pypy-issue