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: Japin Li <japinli(at)hotmail(dot)com>
Cc: Arjan van de Ven <arjan(at)linux(dot)intel(dot)com>, pgsql-hackers(at)postgresql(dot)org, mark(dot)dilger(at)enterprisedb(dot)com, andres(at)anarazel(dot)de, 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-27 01:39:54
Message-ID: 190223.1635298794@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)com> writes:
> Why do we need likely() for base=10, however, base=16 and base=8 don't need?

Yeah, I was a little unconvinced about that too. I concur with writing
it as an if/else chain instead of a switch, but I'm not sure that likely()
adds anything to that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2021-10-27 01:40:09 Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber
Previous Message Japin Li 2021-10-27 01:36:35 Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint