Re: computing completion tag is expensive for pgbench -S -M prepared

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: computing completion tag is expensive for pgbench -S -M prepared
Date: 2018-06-07 14:30:14
Message-ID: 19581.1528381814@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:
> ... 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Cherkashin 2018-06-07 14:30:58 Re: processSQLNamePattern() analog
Previous Message Dmitry Dolgov 2018-06-07 14:08:13 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation