Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
On Sun, 2010-02-21 at 23:05 +0100, Martin v. Loewis wrote: > > It's far from scientific, but I've seen behaviour that's close to a 100% > > performance penalty on a dual-core linux system: > > > >http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2 > > > > Short story: a particular te

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Martin v. Loewis
> It's far from scientific, but I've seen behaviour that's close to a 100% > performance penalty on a dual-core linux system: > >http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2 > > Short story: a particular test suite of mine used to run in around 25 > seconds, but a bit of ctypes

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
On Sun, 2010-02-21 at 22:22 +0100, Martin v. Loewis wrote: > John Nagle wrote: > >I know there's a performance penalty for running Python on a > > multicore CPU, but how bad is it? I've read the key paper > > ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate > > if the GIL ju

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Martin v. Loewis
John Nagle wrote: >I know there's a performance penalty for running Python on a > multicore CPU, but how bad is it? I've read the key paper > ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate > if the GIL just limited Python to running on one CPU at a time, > but it's worse t

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread John Krukoff
On Mon, 2010-02-08 at 01:10 -0800, Paul Rubin wrote: > Stefan Behnel writes: > > Well, if multi-core performance is so important here, then there's a pretty > > simple thing the OP can do: switch to lxml. > > > > http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ > > Well, lxml

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread J Kenneth King
Paul Rubin writes: > Stefan Behnel writes: >> Well, if multi-core performance is so important here, then there's a pretty >> simple thing the OP can do: switch to lxml. >> >> http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ > > Well, lxml is uses libxml2, a fast XML parser w

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Antoine Pitrou
Le Tue, 02 Feb 2010 15:02:49 -0800, John Nagle a écrit : > I know there's a performance penalty for running Python on a multicore > CPU, but how bad is it? I've read the key paper > ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate if > the GIL just limited Python to running on o

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Paul Rubin
Stefan Behnel writes: > Well, if multi-core performance is so important here, then there's a pretty > simple thing the OP can do: switch to lxml. > > http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Well, lxml is uses libxml2, a fast XML parser written in C, but AFAIK it only

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread Stefan Behnel
Paul Rubin, 04.02.2010 02:51: > John Nagle writes: >> Analysis of each domain is >> performed in a separate process, but each process uses multiple >> threads to read process several web pages simultaneously. >> >>Some of the threads go compute-bound for a second or two at a time as >> they par

Re: Overcoming python performance penalty for multicore CPU

2010-02-04 Thread Anh Hai Trinh
On Feb 4, 10:46 am, John Nagle wrote: > >     There's enough intercommunication between the threads working on > a single site that it's a pain to do them as subprocesses. And I > definitely don't want to launch subprocesses for each page; the > Python load time would be worse than the actual work

Re: Overcoming python performance penalty for multicore CPU

2010-02-04 Thread Paul Rubin
John Nagle writes: >There's enough intercommunication between the threads working on > a single site that it's a pain to do them as subprocesses. And I > definitely don't want to launch subprocesses for each page; the > Python load time would be worse than the actual work. The > subprocess mo

Re: Overcoming python performance penalty for multicore CPU

2010-02-04 Thread Paul Rubin
John Nagle writes: > Analysis of each domain is > performed in a separate process, but each process uses multiple > threads to read process several web pages simultaneously. > >Some of the threads go compute-bound for a second or two at a time as > they parse web pages. You're probably bett

Re: Overcoming python performance penalty for multicore CPU

2010-02-03 Thread John Nagle
Steve Holden wrote: John Nagle wrote: Paul Rubin wrote: John Nagle writes: Analysis of each domain is performed in a separate process, but each process uses multiple threads to read process several web pages simultaneously. Some of the threads go compute-bound for a second or two at a tim

Re: Overcoming python performance penalty for multicore CPU

2010-02-03 Thread Steve Holden
John Nagle wrote: > Paul Rubin wrote: >> John Nagle writes: >>> Analysis of each domain is >>> performed in a separate process, but each process uses multiple >>> threads to read process several web pages simultaneously. >>> >>>Some of the threads go compute-bound for a second or two at a time

Re: Overcoming python performance penalty for multicore CPU

2010-02-03 Thread John Nagle
Paul Rubin wrote: John Nagle writes: Analysis of each domain is performed in a separate process, but each process uses multiple threads to read process several web pages simultaneously. Some of the threads go compute-bound for a second or two at a time as they parse web pages. You're pr

Re: Overcoming python performance penalty for multicore CPU

2010-02-02 Thread Terry Reedy
On 2/2/2010 9:02 PM, alex23 wrote: On Feb 3, 9:02 am, John Nagle wrote: I know there's a performance penalty for running Python on a multicore CPU, but how bad is it? I've read the key paper ("www.dabeaz.com/python/GIL.pdf"), of course. It's a shame that Python 3.x is dead to you, other

Re: Overcoming python performance penalty for multicore CPU

2010-02-02 Thread alex23
On Feb 3, 9:02 am, John Nagle wrote: >     I know there's a performance penalty for running Python on a > multicore CPU, but how bad is it?  I've read the key paper > ("www.dabeaz.com/python/GIL.pdf"), of course. It's a shame that Python 3.x is dead to you, otherwise you'd be able to enjoy the ne

Re: Overcoming python performance penalty for multicore CPU

2010-02-02 Thread exarkun
On 11:02 pm, na...@animats.com wrote: I know there's a performance penalty for running Python on a multicore CPU, but how bad is it? I've read the key paper ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate if the GIL just limited Python to running on one CPU at a time, but

Overcoming python performance penalty for multicore CPU

2010-02-02 Thread John Nagle
I know there's a performance penalty for running Python on a multicore CPU, but how bad is it? I've read the key paper ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate if the GIL just limited Python to running on one CPU at a time, but it's worse than that; there's excessive