Re: appendStringInfoString() micro-opt

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: appendStringInfoString() micro-opt
Дата
Msg-id 200401261956.i0QJueB26959@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: appendStringInfoString() micro-opt  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: appendStringInfoString() micro-opt  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Clarify libpq docs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: appendStringInfoString() micro-opt