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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:27:49
Message-ID: 20211028202749.ow2kuli7eeoptifi@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-28 20:34:06 Re: [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint
Previous Message Robert Haas 2021-10-28 20:24:22 Re: Minimal logical decoding on standbys