Re: Proposal: add new API to stringinfo

Tatsuo Ishii <ishii@postgresql.org>

From: Tatsuo Ishii <ishii@postgresql.org>
To: nathandbossart@gmail.com
Cc: dgrowleyml@gmail.com, gurjeet@singh.im, pgsql-hackers@postgresql.org, michael@paquier.xyz, andrew@dunslane.net
Date: 2025-01-09T06:21:41Z
Lists: pgsql-hackers

Attachments

> If it's not too much work to coax the compiler to do so, then I don't see a
> strong reason to avoid it.  Granted, there are probably much more expensive
> parts of the StringInfo support functions (e.g., palloc()), but these are
> hot enough code paths that IMHO it's worth saving whatever cycles we can.

Ok, I have created v3 patch to do more inlining as you suggested. With
the patch I confirmed that there's no call to functions except palloc
in makeStringInfo, makeStringInfoExt, initStringInfo and
initStringInfoExt in the asm codes (see attached stringinfo.s).

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add new StringInfo APIs to allow callers to specify the buffer size.