STINNER Victor <vstin...@python.org> added the comment:
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"]; subprocess.run(args)' 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)! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38061> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com