This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients koobs, vstinner
Date 2020-04-24.10:14:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks Ed Maste, Conrad Meyer, Kyle Evans and Kubilay Kocak!

I ran a benchmark:

vstinner@freebsd$ env/bin/python -m pyperf command -v -- ./python -c 'import subprocess, sys; args=[sys.executable, "-sS", "-c", "pass"];'

The optimization made subprocess almost 4x faster on FreeBSD!

vstinner@freebsd$ env/bin/python -m pyperf compare_to ref.json closefrom.json 
Mean +- std dev: [ref] 176 ms +- 1 ms -> [closefrom] 46.6 ms +- 1.2 ms: 3.77x faster (-74%)

129 ms were wasted in calling 229 284 times close(fd)!
Date User Action Args
2020-04-24 10:14:59vstinnersetrecipients: + vstinner, koobs
2020-04-24 10:14:59vstinnersetmessageid: <>
2020-04-24 10:14:59vstinnerlinkissue38061 messages
2020-04-24 10:14:59vstinnercreate