[Python-ideas] socket module: plain stuples vs named tuples

Victor Stinner victor.stinner at gmail.com
Tue Jun 20 07:12:33 EDT 2017

2017-06-20 4:05 GMT+02:00 INADA Naoki <songofacandy at gmail.com>:
> Namedtuple in Python make startup time slow.
> So I'm very conservative to convert tuple to namedtuple in Python.
> INADA Naoki  <songofacandy at gmail.com>

While we are talking about startup time, I would be curious of seeing
the overhead (python startup time, when importing socket) of the enums
added to socket.py ;-)

"import enum" added to Lib/re.py was a regression causing a slowdown
in the "python_startup" benchmark, but it was related to the site
module importing "re" in Python is running in a virtual environment.
This very specific use case was fixed by not using the re module in
the site module.


More information about the Python-ideas mailing list