[pypy-issue] [issue1436] missed optimization on set contains

Alex Gaynor tracker at bugs.pypy.org
Fri Apr 5 22:57:33 CEST 2013


Alex Gaynor <alex.gaynor at gmail.com> added the comment:

One (possibly missing optimization), is that with literal sets, instead of 
constructing a new set each time you can just put a frozenset in the bytecode, I 
did this optimization for CPython like 7 million years ago, I don't remember if I 
ever ported it to pypy.

Looking at: dis.dis(lambda x: x in {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) should make it 
obvious if we do it or not.

----------
nosy: +agaynor
status: unread -> chatting

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


More information about the pypy-issue mailing list