[issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type

Kirill Balunov report at bugs.python.org
Sat Apr 21 14:52:42 EDT 2018


New submission from Kirill Balunov <kirill.balunov at gmail.com>:

The opcode module contains several collections:

`cmp_op`
`hasconst`
`hasname`
`hasjrel`
...

which are only used for `in` checks. At the same time, they are stored as `list`s and `cmp_op` as tuple. Both these types are not optimal for `__contains__` checks. Maybe it is worth at least to convert them to `frozenset` type after they are filled?

----------
components: Library (Lib)
messages: 315576
nosy: godaygo
priority: normal
severity: normal
status: open
title: Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type
type: performance
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33326>
_______________________________________


More information about the Python-bugs-list mailing list