Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Benjamin Peterson
2013/6/24 Guido van Rossum : > On Mon, Jun 24, 2013 at 7:47 PM, Raymond Hettinger > wrote: >> >> >> >> On Jun 24, 2013, at 4:07 AM, Victor Stinner >> wrote: >> >> Out of curiosity, do you know (remember) how was the number 62 chosen? >> Is it a compromise between memory usage and performances? 62

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Gregory P. Smith
On Jun 24, 2013 9:11 PM, "Guido van Rossum" wrote: > > On Mon, Jun 24, 2013 at 7:47 PM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: >> >> >> >> On Jun 24, 2013, at 4:07 AM, Victor Stinner wrote: >> >>> Out of curiosity, do you know (remember) how was the number 62 chosen? >>> Is it a

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Guido van Rossum
On Mon, Jun 24, 2013 at 7:47 PM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > > > On Jun 24, 2013, at 4:07 AM, Victor Stinner > wrote: > > Out of curiosity, do you know (remember) how was the number 62 chosen? > Is it a compromise between memory usage and performances? 62 is > surpri

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Raymond Hettinger
On Jun 24, 2013, at 4:07 AM, Victor Stinner wrote: > Out of curiosity, do you know (remember) how was the number 62 chosen? > Is it a compromise between memory usage and performances? 62 is > surprising because it is not a power of two :-) > > Is it to just have 64 (2+62) pointers in the struct

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Nick Coghlan
On 25 Jun 2013 09:03, "Steven D'Aprano" wrote: > > On Tue, Jun 25, 2013 at 12:28:09AM +0200, Victor Stinner wrote: > > 2013/6/24 R. David Murray : > > > There is one. -X faulthandler. I'm sure others would agree about > > > -O, but that long predates -X. > > > > FYI I didn't chose "-X" because i

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Steven D'Aprano
On Tue, Jun 25, 2013 at 12:28:09AM +0200, Victor Stinner wrote: > 2013/6/24 R. David Murray : > > There is one. -X faulthandler. I'm sure others would agree about > > -O, but that long predates -X. > > FYI I didn't chose "-X" because it is specific to CPython, but just > because it becomes reall

Re: [Python-Dev] [Python-checkins] cpython: Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods

2013-06-24 Thread Victor Stinner
Oh, I didn't know that."if defined(MS_WIN64) || defined(MS_WINDOWS)" is a common pattern in the Python source code. I simplified the #ifdef in many places: http://hg.python.org/cpython/rev/dfc020b4b123 I also read that MS_WIN32 is always defined on Windows. "#ifdef MS_WIN32" (used in many files, e

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Victor Stinner
2013/6/24 R. David Murray : > There is one. -X faulthandler. I'm sure others would agree about > -O, but that long predates -X. FYI I didn't chose "-X" because it is specific to CPython, but just because it becomes really hard to choose a random letter to add a new option... I prefer long option

Re: [Python-Dev] [Python-checkins] cpython: Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods

2013-06-24 Thread Jeremy Kloth
On Mon, Jun 24, 2013 at 3:48 PM, victor.stinner wrote: > +#if defined(MS_WIN64) || defined(MS_WINDOWS) This test could be reduced to simply `#ifdef MS_WINDOWS`. See PC\pyconfig.h ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/

Re: [Python-Dev] [Python-checkins] cpython: Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64

2013-06-24 Thread Victor Stinner
Ah yes correct, it should be better with the following commit: http://hg.python.org/cpython/rev/3a393fc86b29 Victor 2013/6/24 Jeremy Kloth : > On Mon, Jun 24, 2013 at 3:33 PM, victor.stinner > wrote: >> http://hg.python.org/cpython/rev/6b4d279508a3 >> changeset: 84325:6b4d279508a3 >> user:

Re: [Python-Dev] [Python-checkins] cpython: Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64

2013-06-24 Thread Jeremy Kloth
On Mon, Jun 24, 2013 at 3:33 PM, victor.stinner wrote: > http://hg.python.org/cpython/rev/6b4d279508a3 > changeset: 84325:6b4d279508a3 > user:Victor Stinner > date:Mon Jun 24 23:31:48 2013 +0200 > summary: > Issue #9566: Fix a compiler warning in tupleiter_setstate() on Window

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Brett Cannon
On Mon, Jun 24, 2013 at 4:43 PM, Benjamin Peterson wrote: > 2013/6/24 Maciej Fijalkowski : > > On Sun, Jun 23, 2013 at 6:14 PM, R. David Murray > wrote: > >> On Sun, 23 Jun 2013 17:40:13 +0200, Maciej Fijalkowski < > fij...@gmail.com> wrote: > >>> On Thu, Jun 20, 2013 at 3:36 PM, Brett Cannon >

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Benjamin Peterson
2013/6/24 Maciej Fijalkowski : > On Sun, Jun 23, 2013 at 6:14 PM, R. David Murray > wrote: >> On Sun, 23 Jun 2013 17:40:13 +0200, Maciej Fijalkowski >> wrote: >>> On Thu, Jun 20, 2013 at 3:36 PM, Brett Cannon wrote: >>> > On Wed, Jun 19, 2013 at 11:20 PM, senthil.kumaran >>> > wrote: >>> >>

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread R. David Murray
On Mon, 24 Jun 2013 22:14:46 +0200, Maciej Fijalkowski wrote: > On Sun, Jun 23, 2013 at 6:14 PM, R. David Murray > wrote: > > On Sun, 23 Jun 2013 17:40:13 +0200, Maciej Fijalkowski > > wrote: > >> On Thu, Jun 20, 2013 at 3:36 PM, Brett Cannon wrote: > >> > On Wed, Jun 19, 2013 at 11:20 PM, se

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Alex Gaynor
3.3 adds some -X options around faulthandler if I recall correctly. Alex On Mon, Jun 24, 2013 at 1:14 PM, Maciej Fijalkowski wrote: > On Sun, Jun 23, 2013 at 6:14 PM, R. David Murray > wrote: > > On Sun, 23 Jun 2013 17:40:13 +0200, Maciej Fijalkowski > wrote: > >> On Thu, Jun 20, 2013 at 3:36

Re: [Python-Dev] [Python-checkins] cpython (3.3): Add -b and -X options to python man page.

2013-06-24 Thread Maciej Fijalkowski
On Sun, Jun 23, 2013 at 6:14 PM, R. David Murray wrote: > On Sun, 23 Jun 2013 17:40:13 +0200, Maciej Fijalkowski > wrote: >> On Thu, Jun 20, 2013 at 3:36 PM, Brett Cannon wrote: >> > On Wed, Jun 19, 2013 at 11:20 PM, senthil.kumaran >> > wrote: >> >> .TP >> >> +.BI "\-X " option >> >> +Set im

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #18277: Document quirks of multiprocessing queue.

2013-06-24 Thread Richard Oudkerk
On 24/06/2013 7:30pm, A.M. Kuchling wrote: On Mon, Jun 24, 2013 at 03:53:27PM +0200, richard.oudkerk wrote: http://hg.python.org/cpython/rev/8dcc4e017d42 + but should not cause any pratical difficulties -- you can always ^^ practical + infinitessimal de

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Antoine Pitrou
On Sun, 23 Jun 2013 20:37:37 -0700 Raymond Hettinger wrote: > But it isn't worth all the second guessing (and what feels like sniping). > I've worked on this code for almost a decade. As far as I can tell, none > of the participants in this thread has ever previously shown any interest > in the d

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #18277: Document quirks of multiprocessing queue.

2013-06-24 Thread A.M. Kuchling
On Mon, Jun 24, 2013 at 03:53:27PM +0200, richard.oudkerk wrote: > http://hg.python.org/cpython/rev/8dcc4e017d42 > + but should not cause any pratical difficulties -- you can always ^^ practical > + infinitessimal delay before the queue's :meth:`~Queue.empty`

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Victor Stinner
2013/6/24 Raymond Hettinger : > Changing the BLOCKLEN from 62 to 64 is debatable. > It measureably improved deque_index without an > observable negative effect on the other operations. Out of curiosity, do you know (remember) how was the number 62 chosen? Is it a compromise between memory usage an

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Victor Stinner
2013/6/24 Raymond Hettinger : > Lastly, there was a change I just put in to Py 3.4 replacing > the memcpy() with a simple loop and replacing the > "deque->" references with local variables. Besides > giving a small speed-up, it made the code more clear > and less at the mercy of various implementa

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Victor Stinner
Hi Raymond, Thank you for your long explanation, it is exactly what Antoine asked for :-) I like micro-optimization even if I know that some other developers only see such work as noise, not providing an real speed up :-) So it was interesting to read your email! I'm sorry that you was injured by

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Serhiy Storchaka
24.06.13 03:16, Raymond Hettinger написав(ла): I truly wasn't expecting the Spanish Inquisition :-) I only asked about the reasons. Previous reasons seemed reasonable to me and I wanted to know why a new code is better than the old. It will help me to use the best style in other places. Tha