> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com