Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-109653: Reduce import overhead of uuid module on Linux#115160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This follows in the footsteps ofpython#21586This 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```
I'm not the right person to review this. You need someone who knows whether |
hauntsaninja commentedFeb 8, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the quick response! I'll wait for someone else to review. The value of Line 4296 in1032326
platform.system comes fromos.uname + munging and falling back tosys.platform Note we don't need a one-to-one correspondence here (and I'm not sure there is one, e.g. on ancient Python versions it was possible to have |
This seems correct to me; I don't see any risk to this change. |
…on#115160)This follows in the footsteps ofpython#21586This 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```
…on#115160)This follows in the footsteps ofpython#21586This 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```
Uh oh!
There was an error while loading.Please reload this page.
This follows in the footsteps of#21586
This speeds up import uuid by about 6ms on Linux.
Before:
After: