pgsql: Use appendStringInfoString() where appropriate in elog.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use appendStringInfoString() where appropriate in elog.c.
Date: 2010-11-04 19:29:13
Message-ID: E1PE5Un-0006mt-6C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use appendStringInfoString() where appropriate in elog.c.

The nominally equivalent call appendStringInfo(buf, "%s", str) can be
significantly slower when str is large. In particular, the former usage in
EVALUATE_MESSAGE led to O(N^2) behavior when collecting a large number of
context lines, as I found out while testing recursive functions. The other
changes are just neatnik-ism and seem unlikely to save anything meaningful,
but a cycle shaved is a cycle earned.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=09211659d9d8fd62f9de09703c90ed4f072c4a47

Modified Files
--------------
src/backend/utils/error/elog.c | 51 ++++++++++++++++++++++-----------------
1 files changed, 29 insertions(+), 22 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-11-04 20:34:58 pgsql: Allow moddatetime's target column to be of type timestamptz.
Previous Message Tom Lane 2010-11-04 16:02:26 pgsql: Reimplement planner's handling of MIN/MAX aggregate optimization