From owner-freebsd-python@freebsd.org Thu Nov 19 20:13:13 2015 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5248CA33C88 for ; Thu, 19 Nov 2015 20:13:13 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 36D031D3B for ; Thu, 19 Nov 2015 20:13:13 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: by mailman.ysv.freebsd.org (Postfix) id 35FA6A33C87; Thu, 19 Nov 2015 20:13:13 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3593BA33C86 for ; Thu, 19 Nov 2015 20:13:13 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from lb2-smtp-cloud2.xs4all.net (lb2-smtp-cloud2.xs4all.net [194.109.24.25]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "*.xs4all.nl", Issuer "GlobalSign Domain Validation CA - SHA256 - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B25B11D39 for ; Thu, 19 Nov 2015 20:13:12 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.erewhon.home ([83.162.243.5]) by smtp-cloud2.xs4all.net with ESMTP id jYBx1r00607iGuj01YByKx; Thu, 19 Nov 2015 21:11:58 +0100 Received: by slackbox.erewhon.home (Postfix, from userid 1001) id 3DB241255A; Thu, 19 Nov 2015 21:11:57 +0100 (CET) Date: Thu, 19 Nov 2015 21:11:57 +0100 From: Roland Smith To: Vladimir Bogrecov Cc: python@freebsd.org Subject: Re: Python on FreeBSD is slower than on Linux Message-ID: <20151119201157.GA68473@slackbox.erewhon.home> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2015 20:13:13 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 12, 2015 at 10:26:22PM +0300, Vladimir Bogrecov wrote: > Hello, >=20 > I'm developing a little project on Python 3.5. The server's operating > system is FreeBSD 10.2. Today I decided to do a little test "just for fun" > and the result has confused me. I ran the following code >=20 > import random > import time >=20 >=20 > def test_sort(size): > sequence =3D [i for i in range(0, size)] > random.shuffle(sequence) > start =3D time.time() > ordered_sequence =3D sorted(sequence) > print(time.time() - start) >=20 >=20 > if __name__ =3D=3D '__main__': > test_sort(1000000) On my FreeBSD 10.2 STABLE AMD64 system (Intel Core2 quad Q9300 2.5 GHz, 4 GB RAM) the code prints 1.17 seconds for Python 3.5.0 and 1.21 seconds for Python 2.7.10. Roland --=20 R.F.Smith http://rsmith.home.xs4all.nl/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 5753 3324 1661 B0FE 8D93 FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0) --zhXaljGHf11kAtnf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAABCAAGBQJWTi0EAAoJEED21dyjijPgCrEP/RrGL2zekUquefcQaroN0hpx 8QfswlO9b+8HCT2sfZ4CGAOwzDEI8KWySvq80CaWAWeU1RAoLPBhX/HjX8LwIes6 0sy5QH9zY3iFt1bWOO2VOO9yx5Cqq1qP7OE7aBfM4Z202854KEWzCxFnhBZWzMxc BWsyLbEh9efgqK7ItN6o0A/o1764yhRWChwQ0DOfXOQtHI5y5FowrPzWXFRxi01c SK1hS2M3uW0OnYhj5a4wqS7QpNYXcnEPE20z1Z4s9778tbFJyrpVGxdMqseONjB+ jRdNCY+Nc4dfo5w+BIiz9EliCBfvh+rfInfjmkWGMVizIjWERoSG021jQHvkhWNC 1ztcnEbJWW8jNPCDD6R3swxiYyF9bZc7m4Bz4okBFFkQe6BZqNTfrpDA4s6JLu87 8ucv2jGtXa/4AC3LrUrIs2yOMon5vShqxGtrX5FO4VnXjv1uxpoEqG4Ad+M3w+YJ pGKXWD6JQk47EI8p+TTQ6rCNo7d3GJ9Ht3/4aLhP2S3E5qMM2o7kw4wJh5Gi81Q/ sUJ+6xkL74hWGGWP25F5JS08lun8fGlCmhEX4BDp+gBheKeBqy+cGraqmCzi1p4u PRk5gzTU3lYulXHJaJbHS1sOMftrktFZ79c39c/2jsfKZcToVKPLzG5ghpgIjnXu 5yfAHrx+koByvgVOAMO7 =spfo -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf--