Re: Patch to improve a few appendStringInfo* calls - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Patch to improve a few appendStringInfo* calls
Date
Msg-id CA+Tgmobma9tyOP5R5Ujxkxzq0Fx0BAoCWn77TniV3cQ0G+8MkA@mail.gmail.com
Whole thread Raw
In response to Re: Patch to improve a few appendStringInfo* calls  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
On Mon, Dec 21, 2015 at 6:28 PM, David Rowley
<david.rowley@2ndquadrant.com> wrote:
>  According to grep -rE "appendStringInfoString\(.*\.data\);" . we have 13
> such matches. None of them seem to be in very performance critical places,
> perhaps with the exception of xmlconcat().
>
> Would you say that we should build a macro to wrap up a call to
> appendBinaryStringInfo() or invent another function which looks similar?

The macro probably would have a multiple evaluation hazard, so I'd be
inclined to invent a function.  I mean, yeah, you could use a do {  }
while (0) block to fix the multiple evaluation, but complex macros are
harder to read than functions, and not necessarily any faster.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: fix for readline terminal size problems when window is resized with open pager
Next
From: Robert Haas
Date:
Subject: Re: A typo in syncrep.c