Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint
Date
Msg-id 20211028202749.ow2kuli7eeoptifi@alap3.anarazel.de
Whole thread Raw
In response to Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2021-10-28 13:46:49 -0400, Tom Lane wrote:
> Personally, I failed to measure any speedup at all on pgbench, either
> in the init phase or regular transactions; whatever difference there
> may be is below the noise level.  However, I wrote a simple C function
> with a tight loop around snprintf(), and that showed about a 2X
> improvement, so there is some win here.

Odd - at least with an earlier patch I saw optimized pgbench initialization go
down by ~25%.


> I went ahead and pushed it with a rewritten comment.

Imo the code now is a bit odd, because we first switch (type) setting base,
and then separately have branches for the different bases.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Minimal logical decoding on standbys
Next
From: Tom Lane
Date:
Subject: Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint