On Fri, 17 Jul 2009, Peter Eisentraut wrote:
> On Friday 17 July 2009 16:40:40 Matthew Wakeling wrote:
>> I'm considering rewriting a postgres extension (GiST index bioseg) to make
>> it use version 1 calling conventions rather than version 0.
>>
>> Does anyone have any ideas/opinions/statistics on what the performance
>> difference is between the two calling conventions?
>
> Version 1 is technically slower if you count the number of instructions, but
> considering that everyone else, including PostgreSQL itself, uses version 1,
> and version 0 has been deprecated for years and will break on some
> architectures, it should be a no-brainer.
Is that so?
Well, here's my problem. I have GiST index type called bioseg. I have
implemented the very same algorithm in both a Postgres GiST extension and
as a standalone Java program. In general, the standalone Java program
performs about 100 times faster than Postgres when running a large
index-based nested loop join.
I profiled Postgres a few weeks back, and found a large amount of time
being spent in fmgr_oldstyle.
On Thu, 11 Jun 2009, Tom Lane wrote:
> Matthew Wakeling <matthew@flymine.org> writes:
>> Anyway, running opannotate seems to make it clear that time *is* spent in
>> the gistnext function, but almost all of that is in children of the
>> function. Lots of time is actually spent in fmgr_oldstyle though.
>
> So it'd be worth converting your functions to V1 style.
Are you saying that it would spend just as much time in fmgr_newstyle (or
whatever the correct symbol is)?
Matthew
--
Contrary to popular belief, Unix is user friendly. It just happens to be
very selective about who its friends are. -- Kyle Hearn