diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2025-01-13 11:46:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-13 11:46:13 (GMT) |
commit | 6ff8f82f92a8af363b2bdd8bbaba5845eef430fc (patch) | |
tree | d9a62cfb08820f8bd5c329b95882fb0392371c7b /Doc | |
parent | 39fc7ef4fe211e8f7d3b5a6e392e475ecdfbce72 (diff) | |
download | cpython-6ff8f82f92a8af363b2bdd8bbaba5845eef430fc.zip cpython-6ff8f82f92a8af363b2bdd8bbaba5845eef430fc.tar.gz cpython-6ff8f82f92a8af363b2bdd8bbaba5845eef430fc.tar.bz2 |
gh-128150: Improve performances of `uuid.uuid*` constructor functions. (#128151)
We introduce a private constructor `UUID._from_int()` for RFC 4122/9562 UUIDs,
which takes the integral UUID value as input. The latter must have correctly set
its variant and version bits. We also make `UUID.__init__()` slightly more efficient.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.14.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 72abfeb..474bd6a 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -717,6 +717,22 @@ io file's bytes in full. (Contributed by Cody Maloney and Victor Stinner in :gh:`120754` and :gh:`90102`.) + +uuid +---- + +* Improve generation of :class:`~uuid.UUID` objects via their dedicated + functions: + + * :func:`~uuid.uuid3` and :func:`~uuid.uuid5` are both roughly 40% faster + for 16-byte names and 20% faster for 1024-byte names. Performance for + longer names remains unchanged. + * :func:`~uuid.uuid4` and :func:`~uuid.uuid8` are 30% and 40% faster + respectively. + + (Contributed by Bénédikt Tran in :gh:`128150`.) + + Deprecated ========== |