On Sun, 26 May 2019 at 04:50, Tom Lane <t...@sss.pgh.pa.us> wrote: > > David Rowley <david.row...@2ndquadrant.com> writes: > > 0003: Adds a new function named appendStringInfoStringInfo() which > > appends one StringInfo onto another. Various places did this using > > appendStringInfoString(), but that required a needless strlen() call. > > I can't get excited about this one unless you can point to places > where the savings is meaningful. Otherwise it's just adding mental > burden.
The original idea was just to use appendBinaryStringInfo and make use of the StringInfo's len field. Peter mentioned he'd rather seen a wrapper function here [1]. > > 0004: inlines appendStringInfoString so that any callers that pass in > > a string constant (most of them) can have the strlen() call optimised > > out. > > Here the cost is code space rather than programmer-visible complexity, > but I still doubt that it's worth it. I see on today's master the postgres binary did grow from 8633960 bytes to 8642504 on my machine using GCC 8.3, so you might be right. pg_receivewal grew from 96376 to 96424 bytes. [1] https://www.postgresql.org/message-id/5567B7F5.7050705%40gmx.net -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services