3 ms·
> The one oddity I’ve noticed is that using tuples (including things like named tuples) often speeds up CPython by a lot, but even plain tuples can slow down py
by sitkack 6y ago
> The one oddity I’ve noticed is that using tuples (including things like named tuples) often speeds up CPython by a lot, but even plain tuples can slow down pypy on the same code—in some cases pypy winds up slower than CPython.
I'd love for this to be addressed. namedtuple should be lowered into a fixed sized struct, great opportunity for PyPy to show wins in both memory, memory bandwidth and compute. Add in type stability and PyPy should approach native speeds just by adding in namedtuple.
- mattip 6y agoI created an issue [0] to address this. Could you add a microbenchmark that demonstrates the problem? [0] https://foss.heptapod.net/pypy/pypy/-/issues/3373 https://foss.heptapod.net/pypy/pypy/-/issues/3373