[issue31671] IntFlag makes re.compile slower

Ethan Furman report at bugs.python.org
Thu Oct 5 00:44:41 EDT 2017


Ethan Furman <ethan at stoneleaf.us> added the comment:

INADA Naoki said:
> But while new instance is not created each time, 4 Python method
> calls (e,g.  IntFlag.__and__() -> IntFlag.__new__()
> -> IntFlag._missing_() -> IntFlag._create_pseudo_member_())
> are much slower than int & int.

Only the first two calls always happen -- the last two calls only happen for numbers that haven't been seen yet.  And yes, two Python level calls are much slower than an int & int.

----------

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


More information about the Python-bugs-list mailing list