Re: User class binary ops seem too slow (was re: GIL detector)

2014-08-18 Thread Steven D'Aprano
On Mon, 18 Aug 2014 00:43:58 -0400, Terry Reedy wrote: timeit.repeat('1+1') [0.04067762117549266, 0.019206152658126363, 0.018796680446902643] I think you have been tripped up by the keyhole optimizer. I'm not entirely certain, but that's probably just measuring the overhead of evaluating

Re: GIL detector

2014-08-18 Thread Grant Edwards
On 2014-08-17, Stefan Behnel stefan...@behnel.de wrote: Steven D'Aprano schrieb am 17.08.2014 um 16:21: I wonder whether Ruby programmers are as obsessive about Ruby's GIL? I actually wonder more whether Python programmers are really all that obsessive about CPython's GIL. [...]

GIL detector

2014-08-17 Thread Steven D'Aprano
Coincidentally after reading Armin Ronacher's criticism of the GIL in Python: http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/ I stumbled across this GIL detector script: http://yuvalg.com/blog/2011/08/09/the-gil-detector/ Running it on a couple of my systems, I get

Re: GIL detector

2014-08-17 Thread Johannes Bauer
detector script: http://yuvalg.com/blog/2011/08/09/the-gil-detector/ Running it on a couple of my systems, I get these figures: CPython 2.7: 0.8/2 cores CPython 3.3: 1.0/2 cores Jython 2.5: 2.3/4 cores CPython 2.6: 0.7/4 cores CPython 3.3: 0.7/4 cores CPython 3.4: 0.9/4 cores

Re: GIL detector

2014-08-17 Thread Chris Angelico
On Mon, Aug 18, 2014 at 12:21 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The day will come that even the cheapest, meanest entry-level PC will come standard with 8 cores and the GIL will just be an embarrassment, but today is not that day. I wonder whether Ruby programmers

Re: GIL detector

2014-08-17 Thread Steven D'Aprano
Johannes Bauer wrote: On 17.08.2014 16:21, Steven D'Aprano wrote: Coincidentally after reading Armin Ronacher's criticism of the GIL in Python: http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/ Sure that's the right one? The article you linked doesn't mention the GIL.

Re: GIL detector

2014-08-17 Thread Stefan Behnel
Steven D'Aprano schrieb am 17.08.2014 um 16:21: I wonder whether Ruby programmers are as obsessive about Ruby's GIL? I actually wonder more whether Python programmers are really all that obsessive about CPython's GIL. Sure, there are always the Loud Guys who speak up when they feel like

RE: GIL detector

2014-08-17 Thread Joseph L. Casale
I don't have to care about threading issues all the time and can otherwise freely choose the right model of parallelism that suits my current use case when the need arises (and threads are rarely the right model). I'm sure that's not just me. The sound bite of a loyal Python coder:) If it

Re: GIL detector

2014-08-17 Thread Chris Angelico
On Mon, Aug 18, 2014 at 1:26 AM, Stefan Behnel stefan...@behnel.de wrote: I actually wonder more whether Python programmers are really all that obsessive about CPython's GIL. Sure, there are always the Loud Guys who speak up when they feel like no-one's mentioned it for too long, but I'd

Re: GIL detector

2014-08-17 Thread Chris Angelico
On Mon, Aug 18, 2014 at 2:01 AM, Joseph L. Casale jcas...@activenetwerx.com wrote: If it weren't for these useless threads, you wouldn't have even been able to send that message, let alone do anything on a computer for that matter. Not sure about that. I think it would be entirely possible to

RE: GIL detector

2014-08-17 Thread Steven D'Aprano
Joseph L. Casale wrote: I don't have to care about threading issues all the time and can otherwise freely choose the right model of parallelism that suits my current use case when the need arises (and threads are rarely the right model). I'm sure that's not just me. The sound bite of a

User class binary ops seem too slow (was re: GIL detector)

2014-08-17 Thread Terry Reedy
In a post about CPython's GIL, Steven D'Aprano pointed to Armin Ronacher's criticism of the internal type slots used for dunder methods. http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/ I found the following interesting. Since we have an __add__ method the interpreter will