From owner-freebsd-python@freebsd.org Sat Nov 14 00:21:39 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 B8126A2EDE0 for ; Sat, 14 Nov 2015 00:21:39 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) 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 97A311DF9 for ; Sat, 14 Nov 2015 00:21:39 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: by mailman.ysv.freebsd.org (Postfix) id 96D18A2EDDD; Sat, 14 Nov 2015 00:21:39 +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 7C7D1A2EDDC; Sat, 14 Nov 2015 00:21:39 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2E441DF6; Sat, 14 Nov 2015 00:21:38 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id tAE0Lb8O050864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Nov 2015 16:21:37 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id tAE0LbUW050863; Fri, 13 Nov 2015 16:21:37 -0800 (PST) (envelope-from jmg) Date: Fri, 13 Nov 2015 16:21:37 -0800 From: John-Mark Gurney To: Alfred Perlstein Cc: Vladimir Bogrecov , python@freebsd.org, "freebsd-virtualization@freebsd.org" Subject: Re: Python on FreeBSD is slower than on Linux Message-ID: <20151114002137.GB65715@funkthat.com> References: <5644E9F0.40805@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5644E9F0.40805@freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Fri, 13 Nov 2015 16:21:37 -0800 (PST) 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: Sat, 14 Nov 2015 00:21:39 -0000 Alfred Perlstein wrote this message on Thu, Nov 12, 2015 at 11:35 -0800: > I'm adding Freebsd-virtualization to this thread as both problems point > to some possible issue with FreeBSD as a guest. (although a bare metal > comparison should likely be done as well). This could simply be a python compiled w/ different compiler and compiler optimization flags issue... One easy way to eliminate FreeBSD is to take the Linux version of python, and run it on FreeBSD using the linux emulator to help ensure that the performance is the same when running the same binary on the two OS's... > On 11/12/15 11:26 AM, Vladimir Bogrecov wrote: > > Hello, > > > > 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 > > > > import random > > import time > > > > > > def test_sort(size): > > sequence = [i for i in range(0, size)] > > random.shuffle(sequence) > > start = time.time() > > ordered_sequence = sorted(sequence) > > print(time.time() - start) > > > > > > if __name__ == '__main__': > > test_sort(1000000) > > > > on FreeBSD 10.2 x64 and on Debian 8 x64. Both computers was the smallest > > (5$ per month) virtual machines on the Digital Ocean ( > > https://www.digitalocean.com). The average result on the FreeBSD was 1.5 > > sec, on the Debian 1.0 sec. Both machines was created specially for test > > and had not any customization. Could you help me to understand why python > > is so slower on FreeBSD and may be there are some steps I can perform to > > speed up the python to work not slower than on Debian. > > > > I have found in Google the similar question: > > https://lists.freebsd.org/pipermail/freebsd-python/2012-June/004306.html so > > it has an interest not only for me. > > > > P.S. I really like FreeBSD and I would be happy to solve this issue. If you > > will have an interest to this issue I can provide SSH access for both > > machines :) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."