[Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.c Objects/intobject.c Objects/listobject.c Obje

M.-A. Lemburg mal at egenix.com
Wed Aug 23 17:05:20 CEST 2006


martin at v.loewis.de wrote:
> Zitat von "M.-A. Lemburg" <mal at egenix.com>:
> 
>> PyInts already have all the optimizations you have on your agenda for
>> PyLongs, so I wonder why you're trying to duplicate all this
>> work, instead of building upon it and adding the PyLong features
>> to PyInts.
> 
> Because it doesn't matter. The code would be the same in the end,
> either way: it has to support two cases if two different internal
> representations are chosen.
> 
> If you worry about the efficiency of the arithmetic operations:
> these are TRIVIAL in intobject.c, except for the overflow
> handling.
> 
> What specific optimizations do you think the int implementation
> has?
> 
>> Maybe I'm missing something, but this looks like a much
>> more natural approach to me.
> 
> After reading your messages, it seems that you are missing the
> fact that there aren't really any optimizations in the int
> type, except for the custom allocator (which predates obmalloc)
> and the singleton cache for small ints (which is trivial to
> move to longs).

The optimizations are not in the int type itself, they are
scattered throughout the interpreter. The key to these
optimizations is that it's possible to access the C long
directly via the access macro and thus allowing the compiler
to generate more efficient code.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 23 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list