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

Gregory P. Smith greg at krypto.org
Tue Jun 25 07:07:30 CEST 2013


On Jun 24, 2013 9:11 PM, "Guido van Rossum" <guido at python.org> wrote:
>
> On Mon, Jun 24, 2013 at 7:47 PM, Raymond Hettinger <
raymond.hettinger at gmail.com> wrote:
>>
>>
>>
>> On Jun 24, 2013, at 4:07 AM, Victor Stinner <victor.stinner at gmail.com>
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 structure?
>>
>>
>> Yes, the goal was to have the struct size be an exact multiple
>> of the cache line length (always a power-of-two, typically 64 bytes).
>> What was different then is that deques weren't indexable.
>> When indexing was added, the size of 62 became an
>> unfavorable choice because it made the division and modulo
>> calculation in deque_index() slower than for a power of two.
>
>
> A-ha! Finally an explanation of the change. It makes intuitive sense now.
I think the general feeling is that folks overreacted (perhaps confused by
your silence) and that the reversal will be rolled back. Benjamin?

Seems likely to me.

>
> --
> --Guido van Rossum (python.org/~guido)
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
http://mail.python.org/mailman/options/python-dev/greg%40krypto.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130624/7e495412/attachment-0001.html>


More information about the Python-Dev mailing list