A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/040744.html below:

[Python-Dev] Int FutureWarnings and other 2.4 TODOs

[Python-Dev] Int FutureWarnings and other 2.4 TODOs [Python-Dev] Int FutureWarnings and other 2.4 TODOsThomas Heller theller at python.net
Fri Dec 5 10:17:50 EST 2003
Guido van Rossum <guido at python.org> writes:

>> Hmmmm...  How important is the "less memory" angle versus the "faster"
>> angle?  Why not just add a few bytes to the long type to store an int?
>> If you're using the int, the pointer is NULL, and you're saving that
>> memory, at least.  The only harm is some extra memory in the type
>> object.
>
> I'd say that the "less memory" angle is pretty important.  The int
> implementation has been using every trick in the book to save memory
> from very early days on: it has the most sophisticated special-purpose
> allocator, *and* it uses a cache for popular values, *and* you really
> can't squeeze any more bits out of the structure.

IIUC, doing range(10000000) in a program somewhere allocates 10 million
integers, and these are *never* freed, they live in the cache forever.
Correct?

I do not have an actual use case for this, but it seems somewhat
strange.
And the point comes up from time to time on c.l.p.

Thomas


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4