Re: src/port/snprintf.c: Optimize the common base=10 case in fmtint

From: Arjan van de Ven <arjan(at)linux(dot)intel(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: src/port/snprintf.c: Optimize the common base=10 case in fmtint
Date: 2021-10-26 18:13:14
Message-ID: 384aac2e-84e9-4aea-395b-67c95f6dda08@linux.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/26/2021 10:51 AM, Tom Lane wrote:
> Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com> writes:
>> 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".
>
> I'd be inclined to just hard-wire the three allowed cases, and not have
> an arbitrary-divisor code path at all.
>

ok so feedback is "Yes please but we want more of it" :)

I'll go poke at making an updated patch that does 8/10/16 and nothing else.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-10-26 18:15:35 Re: src/port/snprintf.c: Optimize the common base=10 case in fmtint
Previous Message Andres Freund 2021-10-26 18:04:54 changes in pgport etc doesn't cause client programs to be relinked