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

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-10-26 17:59:34 Re: pg_dump versus ancient server versions
Previous Message Andrew Dunstan 2021-10-26 17:41:32 Re: pg_dump versus ancient server versions