Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2019 16:26:49 +0200
From:      Jan Bramkamp <crest@rlwinm.de>
To:        freebsd-ports@freebsd.org
Subject:   Re: python 3 subprocess performance
Message-ID:  <8f3f8413-60f2-bb03-a6b4-4f6364cdc3df@rlwinm.de>
In-Reply-To: <20190411161649.1b740d21@vm2.home.zagrebin.ru>
References:  <20190411161649.1b740d21@vm2.home.zagrebin.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Please run python under truss -f. Does it try to close(2) all possible
file descriptors? Does the runtime decrease if fdescfs is mounted at
/dev/fd?

On 11.04.19 15:16, Alexander Zagrebin wrote:
> Hi!
> 
> I've noticed the subprocess performance issue with python 3.
> For example, this simple script takes just 0,15 second to complete
> with python 2.7, but more than 5 sec with python 3.6:
> 
> import subprocess
> 
> for i in range(100):
>     p = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>     (stdoutdata, stderrdata) = p.communicate()
> 
> Profiling with the cProfile shows, that this excessive 5 seconds was
> wasted in the "{built-in method posix.read}"
> 
> Could anybody confirm this issue?
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8f3f8413-60f2-bb03-a6b4-4f6364cdc3df>