Re: plperl arginfo

From: Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Subject: Re: plperl arginfo
Date: 2010-10-28 18:11:05
Message-ID: 20101028181105.GA15019@isc.upenn.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 28, 2010 at 01:03:24PM -0400, Andrew Dunstan wrote:
>
>
> On 10/28/2010 12:34 PM, Tom Lane wrote:
> >
> > BTW, maybe we could have the best of both worlds? Dunno about Perl,
> > but in some languages it would be possible to instantiate the hash
> > only if it's actually touched. Passing the data as a hash definitely
> > seems to fit with the spirit of things otherwise, so as long as it
> > didn't cost cycles when not needed, I'd be in favor of that API.
>
> Maybe, but I think that's getting rather beyond my perlguts-fu. I think
> we'd need to do that via PERL_MAGIC_tied, but it's new territory for me.
> Anyone else want to chime in?

Warning, I don't know the plperl, I am just a perl coder.

I do think all the anonymous array are worth worrying about in terms of
performance.

I don't think that tie is necessarily good for performance. tie() is not
generally fast. I think you'd likely be better off writing plain accessors
or using a function to add type info.

Use an accessor for type information, like this?
$ref->typeof($key)

...
or perhaps use a special function?

add_type_info(\%args);

...
or if you want attibute based syntax sugar for the add_type_info() solution...

my %args : pg_record(add_type_info);

Again, these I don't know the plperl code, so I might be missing something
here.

Garick

>
> cheers
>
> andrew
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-10-28 18:41:36 Re: plperl arginfo
Previous Message Tom Lane 2010-10-28 17:50:24 Re: contsel and gist