[Python-Dev] int/float freelists vs pymalloc
"Martin v. Löwis"
martin at v.loewis.de
Sat Feb 9 00:16:06 CET 2008
More information about the Python-Dev mailing list
Sat Feb 9 00:16:06 CET 2008
- Previous message: [Python-Dev] int/float freelists vs pymalloc
- Next message: [Python-Dev] int/float freelists vs pymalloc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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
- Previous message: [Python-Dev] int/float freelists vs pymalloc
- Next message: [Python-Dev] int/float freelists vs pymalloc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list