Re: appendStringInfoString() micro-opt - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: appendStringInfoString() micro-opt
Date
Msg-id 200401261956.i0QJueB26959@candle.pha.pa.us
Whole thread Raw
In response to Re: appendStringInfoString() micro-opt  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: appendStringInfoString() micro-opt
List pgsql-patches
Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
> > This patch replaces a bunch of call sites of appendStringInfo() with
> > appendStringInfoString().
>
> I doubt this saves enough cycles to be worth doing, but if it floats
> your boat ...
>
> When I'm tempted to make a dubious micro-optimization, I always ask
> myself "is it likely that the sum of all machine time saved by this
> change will exceed the amount of person-time I am about to put into
> making it?"  Given the number of places you're talking about touching,
> and the fact that I've never seen appendStringInfo placing high on a
> profile, I suspect this doesn't pass that test.
>
> I'm not objecting to your doing it, exactly, just suggesting that there
> are better things to spend your time on.

Of course, if it makes the code clearer, that is a win in itself.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Clarify libpq docs
Next
From: Tom Lane
Date:
Subject: Re: appendStringInfoString() micro-opt