Re: [Python-Dev] Python startup time

2018年5月02日 21:00:30 -0700

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` and `ssl` 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.
[1]: https://h11.readthedocs.io/en/latest/
I don't have significant estimate how they can make `import requests`
faster, but I believe most of these ideas
are worth enough.
Regards,
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to