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

Re: Optimize PL/Perl function argument passing [PATCH]

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimize PL/Perl function argument passing [PATCH]
Date: 2011-02-02 16:45:52
Message-ID: 20110202164552.GZ719@timac.local (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Mon, Jan 31, 2011 at 02:22:37PM -0500, Andrew Dunstan wrote:
> On 01/15/2011 12:31 AM, Alex Hunsaker wrote:
> >On Tue, Dec 7, 2010 at 07:24, Tim Bunce<Tim(dot)Bunce(at)pobox(dot)com>  wrote:
> >>Changes:
> >>
> >>    Sets the local $_TD via C instead of passing an extra argument.
> >>    So functions no longer start with "our $_TD; local $_TD = shift;"
> >>
> >>    Pre-extend stack for trigger arguments for slight performance gain.
> >>
> >>Passes installcheck.
> >Cool, surprisingly in the non trigger case I saw up to an 18% speedup.

That's great.

> >The trigger case remained about the same, I suppose im I/O bound.
> >
> >Find attached a v2 with some minor fixes, If it looks good to you Ill
> >mark this as "Ready for Commit".
> >
> >Changes:
> >- move up a declaration to make it c90 safe
> >- avoid using tg_trigger before it was initialized
> >- only extend the stack to the size we need (there was + 1 which
> >unless I am missing something was needed because we used to push $_TD
> >on the stack, but we dont any more)
> This looks pretty good. But why are we bothering to keep $prolog at
> all any more, if all we're going to pass it is &PL_sv_no all the
> time? Maybe we'll have a use for it in the future, but right now we
> don't appear to unless I'm missing something.

PostgreSQL::PLPerl::NYTProf would break if it was removed, so I'd rather
it wasn't.

I could work around that if there's an easy way for perl code to tell
what version of PostgreSQL. If there isn't I think it would be worth


In response to


pgsql-hackers by date

Next:From: David E. WheelerDate: 2011-02-02 16:50:59
Previous:From: Heikki LinnakangasDate: 2011-02-02 16:43:59
Subject: Re: Move WAL warning

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