[pypy-issue] [issue1485] all is slow when passed a short generator, much faster with short list

kostia.lopuhin tracker at bugs.pypy.org
Sun May 12 20:38:49 CEST 2013


New submission from kostia.lopuhin <kostia.lopuhin at gmail.com>:

Attached code is 3-10 times slower if all is used like this:

all(v == v0 for v in values[1:])

than if it is passed a list:

all([v == v0 for v in values[1:]])

where values is a list of 4 elements.

jitviewer shows a lot of extra stuff around call of "all" with generator
argument (like call_may_force)

----------
files: all_slow.py
messages: 5712
nosy: kostia.lopuhin, pypy-issue
priority: performance bug
status: unread
title: all is slow when passed a short generator, much faster with short list

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1485>
________________________________________


More information about the pypy-issue mailing list