From a204e08096b0617f03d812c28840d2f39be96fd2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 7 May 2024 11:58:48 +0100 Subject: [PATCH 1/2] gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13 --- Doc/whatsnew/3.13.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index df38a6154701c3..196c10c748fe1f 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -999,6 +999,12 @@ Optimizations section above for details. (Contributed by Jakub Kulik in :gh:`113117`.) +* Several standard library modules have had their import times significantly + improved. The improved modules include :mod:`typing`, :mod:`importlib.metadata`, + :mod:`email.utils`, :mod:`functools` and :mod:`enum`. + (Contributed by Alex Waygood, Shantanu Jain, Adam Turner, Daniel Hollas and + others in :gh:`109653`.) + .. _whatsnew313-jit-compiler: Experimental JIT Compiler From 84d98e67f70ce58a64918abc4cd77bc96883e66c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 7 May 2024 12:17:26 +0100 Subject: [PATCH 2/2] ballpark figure for illustration --- Doc/whatsnew/3.13.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 196c10c748fe1f..898186d7b4af87 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1000,8 +1000,11 @@ Optimizations (Contributed by Jakub Kulik in :gh:`113117`.) * Several standard library modules have had their import times significantly - improved. The improved modules include :mod:`typing`, :mod:`importlib.metadata`, - :mod:`email.utils`, :mod:`functools` and :mod:`enum`. + improved. For example, the import time of the :mod:`typing` module has been + reduced by around a third by removing dependencies on :mod:`re` and + :mod:`contextlib`. Other modules to enjoy import-time speedups include + :mod:`importlib.metadata`, :mod:`threading`, :mod:`enum`, :mod:`functools` + and :mod:`email.utils`. (Contributed by Alex Waygood, Shantanu Jain, Adam Turner, Daniel Hollas and others in :gh:`109653`.)