diff options
author | Eric W <robo-eric@gmx.de> | 2020-10-30 04:56:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 04:56:28 (GMT) |
commit | 8e409cebad42032bb7d0f2cadd8b1e36081d98af (patch) | |
tree | 4347dffac5a388a69782692bfa63075bf8607cdf /Misc | |
parent | 9129af6050b747f288baa9d4e7d43031647ed222 (diff) | |
download | cpython-8e409cebad42032bb7d0f2cadd8b1e36081d98af.zip cpython-8e409cebad42032bb7d0f2cadd8b1e36081d98af.tar.gz cpython-8e409cebad42032bb7d0f2cadd8b1e36081d98af.tar.bz2 |
bpo-42160: tempfile: Reduce overhead of pid check. (GH-22997)
The _RandomSequence class in tempfile used to check the current pid every time its rng property was used.
This commit replaces this code with `os.register_at_fork` to reduce the overhead.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-10-27-00-42-09.bpo-42160.eiLOCi.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-10-27-00-42-09.bpo-42160.eiLOCi.rst b/Misc/NEWS.d/next/Library/2020-10-27-00-42-09.bpo-42160.eiLOCi.rst new file mode 100644 index 0000000..c5f3091 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-10-27-00-42-09.bpo-42160.eiLOCi.rst @@ -0,0 +1 @@ +Replaced pid check in ``tempfile._RandomNameSequence`` with ``os.register_at_fork`` to reduce overhead. |