This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Carl.Friedrich.Bolz, Dennis Sweeney, tim.peters
Date 2022-01-31.06:11:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643609508.12.0.187844878718.issue46558@roundup.psfhosted.org>
In-reply-to
Content
> todecstr treats it as an "input" conversion instead, ...

Worth pointing this out since it doesn't seem widely known: "input" base conversions are _generally_ faster than "output" ones. Working in the destination base (or a power of it) is generally simpler.

In the math.factorial(1000000) example, it takes CPython more than 3x longer for str() to convert it to base 10 than for int() to reconstruct the bigint from that string. Not an O() thing (they're both quadratic time in CPython today).
History
Date User Action Args
2022-01-31 06:11:48tim.peterssetrecipients: + tim.peters, Carl.Friedrich.Bolz, Dennis Sweeney
2022-01-31 06:11:48tim.peterssetmessageid: <1643609508.12.0.187844878718.issue46558@roundup.psfhosted.org>
2022-01-31 06:11:48tim.peterslinkissue46558 messages
2022-01-31 06:11:48tim.peterscreate