OSDN Git Service

Use appendStringInfoString() where appropriate in elog.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Nov 2010 19:28:35 +0000 (15:28 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Nov 2010 19:28:35 +0000 (15:28 -0400)
commit09211659d9d8fd62f9de09703c90ed4f072c4a47
tree34e3afdb95e2fdd71417f0d12ac3dcd87dd7a74c
parent034967bdcbb0c7be61d0500955226e1234ec5f04
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.
src/backend/utils/error/elog.c