> On Oct 26, 2021, at 7:57 AM, Arjan van de Ven <ar...@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 special cased as well?  I don't see much 
use in optimizing for octal, but hexadecimal is used quite a bit in wal with 
patterns like "%08X%08X%08X".

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





Reply via email to