From owner-freebsd-python@freebsd.org Thu Nov 12 20:40:21 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 28FD7A2DC69 for ; Thu, 12 Nov 2015 20:40:21 +0000 (UTC) (envelope-from pgollucci@p6m7g8.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 F2FA71089 for ; Thu, 12 Nov 2015 20:40:20 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: by mailman.ysv.freebsd.org (Postfix) id F1930A2DC67; Thu, 12 Nov 2015 20:40:20 +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 F11BDA2DC65 for ; Thu, 12 Nov 2015 20:40:20 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCAE91088 for ; Thu, 12 Nov 2015 20:40:20 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: by ioir85 with SMTP id r85so36788296ioi.1 for ; Thu, 12 Nov 2015 12:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=p6m7g8_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FZV+nKwVAFnhb95LsjV62cyg8Vaak2QjgztBfOjSc7s=; b=ytl0vspU9b44KktmxkQnSt+cd1tFOd0WEjBC3ZL1y5X+aHSY5/zXF+IE4bc5Xc0BTN xXF2eJ/XD6Q1bociWCuk7atvKqcgWisjyVMEjhFZRQUPGF6eoTAzcwfrJ+MnmeFXot6r j3kUkdqFfz6675xk9lQnYCIJi8l0JpomqaQ4Z+1OzmUu3t13Gr2RJC5Rz2Xk+159vjNG qYYR41HyDamhdO9ZRyvX82VUqmKFsMeRQ7dK74VFt3X24BG+8uSZT3ZQmLTPgNC0L8D1 Q1Ztln9BAT/AHt/Oqu9qs7n54jqV9hpiYu4SMuOzmxFOc7byZTh6BSbP7ine1uca2XgI aR+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FZV+nKwVAFnhb95LsjV62cyg8Vaak2QjgztBfOjSc7s=; b=gJpLib1vv5EhGX56qen4sNI/3fwNnUk4dE43UhOTH7UPkgIwrIeOZB1UfFO7ZQ/GXn l84HcDhIW7lS8BVVTcEB+wpVFegBaeaqk0kdY/+9UJm0aBGY3kVwKY40n4CwD80V+JtQ RpMoQzHhf2WKpusGWJHjfswZ4mR0xHUwPVydufw6TtTtyPTRaQTbzxq1CB1DT4hbKXie mFcAbFT1GyCfZaEn6TSUGaPXDJju5Fq+fOiDTtA1L/sgrEebtNVgYO8ymlidHLDkAEZI C2couJa1WBu/PLuCphyF1hsyhXHl7B+AJpdVvvx7l1WP01fORtJ9FBK/MnoQiMR0tvhC oiaw== X-Gm-Message-State: ALoCoQkTm7XxfYy2TTCxqg/ENF20gPGQZIDwdvtCxDCLAKAcrty5+KuIXq+6ZKxyCfMnlmqf2XK4 MIME-Version: 1.0 X-Received: by 10.107.32.17 with SMTP id g17mr19346558iog.55.1447360819878; Thu, 12 Nov 2015 12:40:19 -0800 (PST) Received: by 10.50.98.40 with HTTP; Thu, 12 Nov 2015 12:40:19 -0800 (PST) X-Originating-IP: [2600:1003:b00e:f96:34d5:dfdc:cc5a:a43b] In-Reply-To: References: Date: Thu, 12 Nov 2015 15:40:19 -0500 Message-ID: Subject: Re: Python on FreeBSD is slower than on Linux From: "Philip M. Gollucci" To: Vladimir Bogrecov Cc: "python@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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, 12 Nov 2015 20:40:21 -0000 Most likely its /dev/random or gettimeofday being slow which have nothing to do with Python. On Thursday, November 12, 2015, 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 :) > > Thank You! > _______________________________________________ > freebsd-python@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-python > To unsubscribe, send any mail to "freebsd-python-unsubscribe@freebsd.org > " > -- --------------------------------------------------------------------------------- Curb: Your ride is here 4096R/D21D2752 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.