Date: Thu, 12 Nov 2015 15:40:19 -0500 From: "Philip M. Gollucci" <pgollucci@p6m7g8.com> To: Vladimir Bogrecov <bogrecov@gmail.com> Cc: "python@freebsd.org" <python@freebsd.org> Subject: Re: Python on FreeBSD is slower than on Linux Message-ID: <CACM2dAYcCtsw%2Bm02Vx4ky6oSQA_Yz7Sr5c6HM80_hCKhR4pc9Q@mail.gmail.com> In-Reply-To: <CANx%2B6QKT00ZC4Gh3UHp7qW6mtKJHLn_NkMD1gegTYgiu=gByXg@mail.gmail.com> References: <CANx%2B6QKT00ZC4Gh3UHp7qW6mtKJHLn_NkMD1gegTYgiu=gByXg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Most likely its /dev/random or gettimeofday being slow which have nothing to do with Python. On Thursday, November 12, 2015, Vladimir Bogrecov <bogrecov@gmail.com> 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 :) > > Thank You! > _______________________________________________ > freebsd-python@freebsd.org <javascript:;> mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-python > To unsubscribe, send any mail to "freebsd-python-unsubscribe@freebsd.org > <javascript:;>" > -- --------------------------------------------------------------------------------- Curb: Your ride is here 4096R/D21D2752 <http://pgp.mit.edu/pks/lookup?op=get&search=0xF699A450D21D2752> ECDF B597 B54B 7F92 753E E0EA F699 A450 D21D 2752 Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. Director IT Operations, Curb What doesn't kill us can only make us stronger; Except it almost kills you.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACM2dAYcCtsw%2Bm02Vx4ky6oSQA_Yz7Sr5c6HM80_hCKhR4pc9Q>