]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109653: Reduce import overhead of uuid module on Linux (#115160)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Wed, 6 Mar 2024 22:39:43 +0000 (14:39 -0800)
committerGitHub <noreply@github.com>
Wed, 6 Mar 2024 22:39:43 +0000 (14:39 -0800)
commit68b8ffff8c4b20d2f46b708b1a7906377ecc255f
tree489afdf2dd9810a93ba4eb9ad182e1ac38193f8d
parent0876b921b28bb14e3fa61b188e52fc9b4c77cb1a
gh-109653: Reduce import overhead of uuid module on Linux (#115160)

This follows in the footsteps of #21586
This speeds up import uuid by about 6ms on Linux.

Before:
```
λ hyperfine -w 4 "./python -c 'import uuid'"
Benchmark 1: ./python -c 'import uuid'
  Time (mean ± σ):      20.4 ms ±   0.4 ms    [User: 16.7 ms, System: 3.8 ms]
  Range (min … max):    19.6 ms …  21.8 ms    136 runs
```
After:
```
λ hyperfine -w 4 "./python -c 'import uuid'"
Benchmark 1: ./python -c 'import uuid'
  Time (mean ± σ):      14.5 ms ±   0.3 ms    [User: 11.5 ms, System: 3.2 ms]
  Range (min … max):    13.9 ms …  16.0 ms    175 runs
```
Lib/uuid.py
Misc/NEWS.d/next/Documentation/2024-02-08-08-51-37.gh-issue-109653.QHLW4w.rst [new file with mode: 0644]