Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2019 16:04:31 +0200
From:      Konstantin Schukraft <konstantin@schukraft.org>
To:        Alexander Zagrebin <alex@zagrebin.ru>
Cc:        ports@freebsd.org
Subject:   Re: python 3 subprocess performance
Message-ID:  <20190411140431.b3s2yt4bvmrusqsc@laparbeit>
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

--yl2n2f32g2fcaqrk
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Disposition: inline

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?

I see this on HardenedBSD 12 with python2.7 (fast) and python3.6 and 3.7
(both slow) installed from packages.
Interestingly, I don't see this on my FreeNAS 11.3, where python2.7 and
3.6 are both installed by default and run fast.


Hope that helps,

Konstantin

--yl2n2f32g2fcaqrk
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQT5hlD1gMfKZVmJgKBt4hVX4L8dwAUCXK9JbgAKCRBt4hVX4L8d
wEs7APwMfoLfy+Kl6eCKI0bGsNH/+5gfI9cjilFZUMDf5ZwcTwD9GLOLvRthk91d
8eBCN+EJVX9JqHlEKaI9QWNrVnQN5Q8=
=ptWB
-----END PGP SIGNATURE-----

--yl2n2f32g2fcaqrk--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190411140431.b3s2yt4bvmrusqsc>