Skip site navigation (1) Skip section navigation (2)

Re: Calling conventions

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Calling conventions
Date: 2009-07-17 16:09:22
Message-ID: alpine.DEB.2.00.0907171702510.26059@aragorn.flymine.org (view raw or flat)
Thread:
Lists: pgsql-performance
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(at)flymine(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2009-07-17 16:34:29
Subject: Re: Calling conventions
Previous:From: Peter EisentrautDate: 2009-07-17 15:32:12
Subject: Re: Calling conventions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group