> On Oct 26, 2021, at 7:57 AM, Arjan van de Ven <arjan@linux.intel.com> wrote:
>
> By special casing the super common case of base==10, the (gcc) compiler can (and will)
> replace the divide by a multiply with 0xcccccccccccccccd, yielding a lot faster code.
> (fmtint dropped drastically in the perf profiles after this change)
It appears fmtint only has three options for base, being 10, 16, and 8. Have you profiled with either of the others
specialcased as well? I don't see much use in optimizing for octal, but hexadecimal is used quite a bit in wal with
patternslike "%08X%08X%08X".
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company