Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Baptiste Daroussin
On Fri, Nov 13, 2015 at 12:36:29PM +1100, Kubilay Kocak wrote:
> On 13/11/2015 6: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(100)
> > 
> > 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!
> 
> From FreeBSD Python's (team) point of view, I can't think of anything
> obvious off the top of my head that might cause a ~30% performance issue
> for that workload.
> 
> Let's get a trace (truss, strace, dtrace) of what's going during the run
> so we can figure out exactly what's happening and in what context.
> 
> With respect to the testing environment, certain VPS providers throttle
> bursts of CPU pretty heavily, so you'll want to account for/isolate that
> as a potential contributor. Yes both OS's are being run on the same
> provider, but as Alfred said, one OS may be mitigating/working around
> certain virtualisation 'issues'.
> 
> A full trace of what the test case is doing is definitely the next best
> step I can think of, even before profiling in python, which is probably
> going to provide insight as well.
> 
> Personally, I'd love to hear about anything that might result in FreeBSD
> always topping the charts for Python performance.
> 
Well the python devs are aware by themselves of potential performances issues on
FreeBSD (and non linux in general) for example subprocess will try to close fds,
on linux by getting the list of fd from /proc/fd and only close the one they do
not want among the existing ones. on freebsd they do the same if /dev/fd is
mounted meaning without /dev/fd, perfs will suck. They do not use closefrom(2)
here because on linux it is not async-signal-safe. one could make them use
closefrom(2) on non linux for example or even more efficiently but freebsd only
modify the code to use kinfo_getfile(3).

https://bugs.python.org/issue11284

Another area is the AIO iirc (needs to be double checked) the python uses linux
only things for aio which makes this way slower on FreeBSD.

I'm kind of surprised given the number of pythonic people we have that no one
has had a look at how python perform on FreeBSD and how things are implemented
in the python VM to help them.

Bapt


signature.asc
Description: PGP signature


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Mark Blackman
On 12 Nov 2015, at 19:35, Alfred Perlstein  wrote:
> 
> 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).
> 
> -Alfred
> 
>> 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(100)
>> 
>> 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!

I have some memory that the gettimeofday is quite expensive on FreeBSD as a 
result of substantially more accuracy and I reckon that test script is calling 
it about 2 million times.

Mark
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Konstantin Belousov
On Fri, Nov 13, 2015 at 09:01:57AM +0100, Baptiste Daroussin wrote:
> On Fri, Nov 13, 2015 at 12:36:29PM +1100, Kubilay Kocak wrote:
> > On 13/11/2015 6: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(100)
> > > 
> > > 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!
> > 
> > From FreeBSD Python's (team) point of view, I can't think of anything
> > obvious off the top of my head that might cause a ~30% performance issue
> > for that workload.
> > 
> > Let's get a trace (truss, strace, dtrace) of what's going during the run
> > so we can figure out exactly what's happening and in what context.
> > 
> > With respect to the testing environment, certain VPS providers throttle
> > bursts of CPU pretty heavily, so you'll want to account for/isolate that
> > as a potential contributor. Yes both OS's are being run on the same
> > provider, but as Alfred said, one OS may be mitigating/working around
> > certain virtualisation 'issues'.
> > 
> > A full trace of what the test case is doing is definitely the next best
> > step I can think of, even before profiling in python, which is probably
> > going to provide insight as well.
> > 
> > Personally, I'd love to hear about anything that might result in FreeBSD
> > always topping the charts for Python performance.
> > 
> Well the python devs are aware by themselves of potential performances issues 
> on
> FreeBSD (and non linux in general) for example subprocess will try to close 
> fds,
> on linux by getting the list of fd from /proc/fd and only close the one they 
> do
> not want among the existing ones. on freebsd they do the same if /dev/fd is
> mounted meaning without /dev/fd, perfs will suck. They do not use closefrom(2)
> here because on linux it is not async-signal-safe. one could make them use
> closefrom(2) on non linux for example or even more efficiently but freebsd 
> only
> modify the code to use kinfo_getfile(3).
> 
> https://bugs.python.org/issue11284
> 
> Another area is the AIO iirc (needs to be double checked) the python uses 
> linux
> only things for aio which makes this way slower on FreeBSD.
> 
> I'm kind of surprised given the number of pythonic people we have that no one
> has had a look at how python perform on FreeBSD and how things are implemented
> in the python VM to help them.

Note that the code provided does not do any system actions at all.  It is,
I guess, is pure calculation and probably memory allocation.  The later,
for the initial warm-up, may have different constant cost between different
implementations of malloc/operating system/policy put by hypervisor on
the OS access patterns to memory.

In other words, to meaningfully compare apples to apples, the testing
must isolate each variadic part. Run the tests on the same _real_
hardware, provide the warm-up to isolate the initialization cost, do
statistically-meaningful analysis. Do trace the test e.g. using ktrace
to see the program<->system iteration, in particular, ktrace allows to
see the page faults experienced by the execution.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Mark Blackman


> On 13 Nov 2015, at 08:08, Mark Blackman  wrote:
> 
>> On 12 Nov 2015, at 19:35, Alfred Perlstein  wrote:
>> 
>> 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).
>> 
>> -Alfred
>> 
>>> 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(100)
>>> 
>>> 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!
> 
> I have some memory that the gettimeofday is quite expensive on FreeBSD as a 
> result of substantially more accuracy and I reckon that test script is 
> calling it about 2 million times.

Doh, never mind, misread the python. Just twice. :)
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Bug ID: 204519
   Summary: Mk/Uses/python.mk: Set Python 3.5 as the default 3.x
version
   Product: Ports & Packages
   Version: Latest
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Only Me
  Priority: ---
 Component: Ports Framework
  Assignee: port...@freebsd.org
  Reporter: gerard_seib...@outlook.com
CC: freebsd-ports-b...@freebsd.org, pyt...@freebsd.org

I would like to request that python 3.5 be set as the default 3,X version. It
was released on 09/13/2015 and is apparently quite stable.

Thank You :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Kubilay Kocak  changed:

   What|Removed |Added

   Keywords||easy, needs-patch
   Assignee|port...@freebsd.org |ko...@freebsd.org
 Status|New |Open

--- Comment #1 from Kubilay Kocak  ---
I'll take this (as I requested the issue be created)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #2 from Mathieu Arnold  ---
it should be given to portmgr for exp-run, why take it back ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Kubilay Kocak  changed:

   What|Removed |Added

  Flags||exp-run?

--- Comment #3 from Kubilay Kocak  ---
I can request an exp-run whilst being 'current responsible' (assignee)

Having said that, if you want to create a patch and take it for an exp-run, by
all means :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #4 from Kubilay Kocak  ---
Also note, it's still within the Ports Framework component, and the change
technically doesn't require portmgr approval. But certainly an exp-run is
warranted for this kind of change

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #5 from Mathieu Arnold  ---
(In reply to Kubilay Kocak from comment #3)
> I can request an exp-run whilst being 'current responsible' (assignee)
> 
> Having said that, if you want to create a patch and take it for an exp-run,
> by all means :)

When you want an exp-run, you assign the pr to portmgr, it'll get back to you
when the exp-run is done.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Antoine Brodin  changed:

   What|Removed |Added

 CC|freebsd-ports-bugs@FreeBSD. |
   |org |
   Assignee|ko...@freebsd.org   |port...@freebsd.org

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/Uses/python.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Kubilay Kocak  changed:

   What|Removed |Added

   Keywords||needs-qa

--- Comment #6 from Kubilay Kocak  ---
OK, portmgr will handle this one.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/bsd.default-versions.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Kubilay Kocak  changed:

   What|Removed |Added

Summary|Mk/Uses/python.mk: Set  |Mk/bsd.default-versions.mk:
   |Python 3.5 as the default   |Set Python 3.5 as the
   |3.x version |default 3.x version

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/bsd.default-versions.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

Andrew Berg  changed:

   What|Removed |Added

 CC||aberg...@my.hennepintech.ed
   ||u

--- Comment #7 from Andrew Berg  ---
Making the default 3.5 will break many things because of limitations in
Poudriere and/or ports. Currently, Poudriere cannot calculate dependencies of
dependencies correctly for Python. Because of the isolation that Poudriere
enforces, it can build dependencies for the *default* version of Python rather
than what is needed to satisfy the dependency. Samba and Salt are good examples
- go try to build packages for them using Poudriere with 3.x set as the default
Python.

IIRC, Baptiste is trying to solve issues like this with subpackages, where a
port can then depend on a specific subpackage which is built with specific
options rather than a port, which can have any arbitrary options set.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/bsd.default-versions.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #8 from Kubilay Kocak  ---
@Andrew, is this a change (better/worse/same) in behaviour from 3.4 being the
current 3.x default?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/bsd.default-versions.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #9 from Andrew Berg  ---
(In reply to Kubilay Kocak from comment #8)
It's the same. A port wants the py27-foo package because it needs 2.7, but the
py34-foo package was built instead because 3.4 was the default and foo supports
both 2.x and 3.x. You'd just get py35-foo instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


[Bug 204519] Mk/bsd.default-versions.mk: Set Python 3.5 as the default 3.x version

2015-11-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204519

--- Comment #10 from Kubilay Kocak  ---
So that would leave us in the net same position, except with 3.5 as the default
version (which is the upstream recommendation: use the latest point release of
a major version branch).

Any poudriere/pkg/framework issues need to be resolved independently (im with
you, this would be really nice) and does not block this issue .

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Alfred Perlstein
Vladimir ,

Please run truss(1) against the python code and paste a subset here. Maybe it 
is doing many semaphore ops. 

Sent from my iPhone

> On Nov 13, 2015, at 12:49 AM, Mark Blackman  wrote:
> 
> Vladimir
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Alfred Perlstein



On 11/12/15 12:40 PM, Philip M. Gollucci wrote:

Most likely its /dev/random or gettimeofday being slow which have nothing
to do with Python.


Urm... so like if FreeBSD's getpid was 100x slower than Linux's then 
what exactly would it be?


If FreeBSD's implementation is needlessly precise (and hence slow) for 
Python, then our platform should have a workaround "fast version" that 
Linux has.  The "fast" version doesn't have to be the default (although 
linux's massive marketshare would prove otherwise) however our port 
should be patched to use the fast version.


-Alfred


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(100)

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-unsubscr...@freebsd.org
"





___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread Alfred Perlstein



On 11/13/15 12:01 AM, Baptiste Daroussin wrote:
I'm kind of surprised given the number of pythonic people we have that 
no one has had a look at how python perform on FreeBSD and how things 
are implemented in the python VM to help them. Bapt 
Did this recently in a few places however not in this one.  Having a 
syscall to give the list of open fds would be pretty a++.


-Alfred
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"


Re: Python on FreeBSD is slower than on Linux

2015-11-13 Thread John-Mark Gurney
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(100)
> >
> > 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."
___
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"