Issue 32383: subprocess.Popen() is slower than subprocess.run() (original) (raw)

Issue32383

Created on 2017-12-20 09:57 by Николай Соколов, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg308711 - (view) Author: Николай Соколов (Николай Соколов) Date: 2017-12-20 09:57
Hello. I noticed different speed of application, which was execute with subprocess.Popen() and subprocess.run(). I tested on Linux Ubuntu 17.04 and Windows 10. My command line is: "ffmpeg -i big_buck_bunny_480p_surround-fix.avi -f null -" you can use any video file on your PC. I used ffmpeg (open source encoder/decoder/and etc.), but you can use any applications, which counts himself speed of work. I got a difference in speed: Using by terminal: fps=4402 (frame per second); Using by run(): fps=4019; Using by Popen(): fps=3431; On Windows is difference about 5% percent, on Linux about 10% percent. I did not use additional flags. All by default. I downloaded video stream here https://peach.blender.org/download/
msg308724 - (view) Author: Николай Соколов (Николай Соколов) Date: 2017-12-20 11:33
I incorrectly used the loop to check if the process is alive: while process.poll() is None: pass else: stdout, stderr = process.communicate()
History
Date User Action Args
2022-04-11 14:58:55 admin set github: 76564
2017-12-20 11:33:51 Николай Соколов set status: open -> closedresolution: not a bugmessages: + stage: resolved
2017-12-20 09:57:21 Николай Соколов create