Re: [PATCH v2] 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: Andres Freund <andres(at)anarazel(dot)de>
Cc: Chapman Flack <chap(at)anastigmatix(dot)net>, Arjan van de Ven <arjan(at)linux(dot)intel(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, mark(dot)dilger(at)enterprisedb(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint
Date: 2021-10-28 20:34:06
Message-ID: 553198.1635453246@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> Imo the code now is a bit odd, because we first switch (type) setting base,
> and then separately have branches for the different bases.

It'd be hard to merge, I think, given that the cases in the switch
don't line up one-for-one with the different bases. You could
probably do something involving falling through between different
cases, but I think that that would be a lot harder to read;
and I'm still of the opinion that micro-optimizing this code
is probably a waste of effort for our usage.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-10-28 21:05:50 Re: Correct error message for end-of-recovery record TLI
Previous Message Andres Freund 2021-10-28 20:27:49 Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint