Re: appendBinaryStringInfo stuff

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: appendBinaryStringInfo stuff
Date: 2022-12-19 20:23:09
Message-ID: 347ad93d-fb14-8109-376b-8930d7d56027@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19.12.22 09:12, Andres Freund wrote:
>> There are a bunch of places in the json code that use
>> appendBinaryStringInfo() where appendStringInfoString() could be used, e.g.,
>>
>> appendBinaryStringInfo(buf, ".size()", 7);
>>
>> Is there a reason for this? Are we that stretched for performance?
> strlen() isn't that cheap, so it doesn't generally seem unreasonable. I
> don't think we should add the strlen overhead in places that can
> conceivably be a bottleneck - and some of the jsonb code clearly can be
> that.

AFAICT, the code in question is for the text output of the jsonpath
type, which is used ... for barely anything?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ted Yu 2022-12-19 20:48:05 Re: Add sub-transaction overflow status in pg_stat_activity
Previous Message Peter Eisentraut 2022-12-19 20:09:25 Re: meson files copyright