Re: computing completion tag is expensive for pgbench -S -M prepared - Mailing list pgsql-hackers

From Tom Lane
Subject Re: computing completion tag is expensive for pgbench -S -M prepared
Date
Msg-id 19581.1528381814@sss.pgh.pa.us
Whole thread Raw
In response to computing completion tag is expensive for pgbench -S -M prepared  (Andres Freund <andres@anarazel.de>)
Responses Re: computing completion tag is expensive for pgbench -S -M prepared
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> ...  That's actually fairly trivial to optimize - we don't
> need the full blown snprintf machinery here.  A quick benchmark
> replacing it with:

>                        memcpy(completionTag, "SELECT ", sizeof("SELECT "));
>                        pg_lltoa(nprocessed, completionTag + 7);

While I don't have any objection to this change if the speedup is
reproducible, I do object to spelling the same constant as
'sizeof("SELECT ")' and '7' on adjacent lines ...

            regards, tom lane


pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: Transform for pl/perl
Next
From: Sergey Cherkashin
Date:
Subject: Re: processSQLNamePattern() analog