Re: [PATCHES] Text <-> C string - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Text <-> C string
Date
Msg-id 26079.1205988202@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Text <-> C string  ("Brendan Jurd" <direvus@gmail.com>)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> One of the questions in the original patch submission was whether it
> would be worth changing all those DirectFunctionCall(textin) and
> (textout) calls to use the new functions.  Is it worthwhile avoiding
> the fmgr overhead?

I think that's worth doing just on notational clarity grounds.
The small cycle savings doesn't excite me, but understanding
DirectFunctionCall1(textin, CStringGetDatum(foo)) just involves
more different bits of trivia than cstring_to_text(foo).

> Last time I looked, the codebase had shifted quite a bit since I
> originally wrote the patch.  So it probably needs some work to apply
> cleanly on the latest sources anyway.

Yeah, with wide-impact patches like this you are always going to have
that problem.  One point though is that we don't have to improve every
call site at the same time.  I'd be inclined to put in the new functions
and hit some representative sample of utils/adt/ files in the first
commit, and then incrementally fix other stuff.

            regards, tom lane

pgsql-hackers by date:

Previous
From: "Omar Bettin"
Date:
Subject: diabolic state
Next
From: longlong
Date:
Subject: Re: COPY issue(gsoc project)