[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

martin at v.loewis.de martin at v.loewis.de
Wed Aug 23 16:48:22 CEST 2006


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).

Regards,
Martin





More information about the Python-checkins mailing list