[PATCH] mini-gmp: avoid a mpz_sizeinbase call in mpz_get_str

Pádraig Brady P at draigBrady.com
Thu Oct 8 13:32:17 CEST 2026


This two line patch avoids obviously redundant work,
which results in 10x faster basenc --base58 at least.

Note the attached patch is against the latest snapshot (gmp-6.3.0-20260920...)
as the hg repo is throwing permission denied or connection refused errors.

thanks,
Padraig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpz_get_str-fast.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20261008/89ea8c0c/attachment.bin>


More information about the gmp-devel mailing list