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/2008-February/076785.html below:

[Python-Dev] int/float freelists vs pymalloc

[Python-Dev] int/float freelists vs pymalloc [Python-Dev] int/float freelists vs pymalloc"Martin v. Löwis" martin at v.loewis.de
Sat Feb 9 00:16:06 CET 2008
> Given the background information Python's long implementation could
> probably optimized. In 3.0 a long has 3 4-byte members (ref count,
> ob_size and *ob_type) plus one to many unsigned shorts (2 bytes each) to
> hold the value. If pymalloc aligns the objects at 8 byte address
> boundaries wouldn't it be better and slightly faster to use unsigned
> ints instead of unsigned shorts?

You mean, as the digits? You would have to rewrite the entire long
datatype, which is a tedious exercise. Plus, I believe you would have
to make some operations 64-bit on all systems: when you multiply
digits today, the product will be 32-bit. If you extend the digits,
you might get 64-bit results, which will be slow on 32-bit systems
(plus some 32-bit systems don't support a 64-bit integer type at all
in their compilers).

Regards,
Martin
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