[Python-Dev] Python startup time (original) (raw)
INADA Naoki songofacandy at gmail.com
Wed May 2 23:57:28 EDT 2018
- Previous message (by thread): [Python-Dev] Python startup time
- Next message (by thread): [Python-Dev] Python startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Recently, I reported how stdlib slows down import requests
.
https://github.com/requests/requests/issues/4315#issuecomment-385584974
For Python 3.8, my ideas for faster startup time are:
- Add lazy compiling API or flag in
re
module. The pattern is compiled when first used. - Add IntEnum and IntFlag alternative in C, like PyStructSequence for
namedtuple.
It will make importing
socket
andssl
module much faster. (Both module has huge enum/flag). - Add special casing for UTF-8 and ASCII in TextIOWrapper. When application uses only UTF-8 or ASCII, we can skip importing codecs and encodings package entirely.
- Add faster and simpler http.parser (maybe, based on h11 1) and avoid using email module in http module.
I don't have significant estimate how they can make import requests
faster, but I believe most of these ideas
are worth enough.
Regards,
- Previous message (by thread): [Python-Dev] Python startup time
- Next message (by thread): [Python-Dev] Python startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]