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

Поиск
Список
Период
Сортировка
От Tim Bunce
Тема Re: Optimize PL/Perl function argument passing [PATCH]
Дата
Msg-id 20101208171431.GT89294@timac
обсуждение исходный текст
Ответ на Re: Optimize PL/Perl function argument passing [PATCH]  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Optimize PL/Perl function argument passing [PATCH]  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
On Tue, Dec 07, 2010 at 10:00:28AM -0500, Andrew Dunstan wrote:
> 
> 
> On 12/07/2010 09:24 AM, Tim Bunce 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.
> 
> Please add it to the January commitfest.

Done. https://commitfest.postgresql.org/action/patch_view?id=446

> Have you measured the speedup gained from this?

No. I doubt it's significant, but "every little helps" :)

> Do you have any more improvements in the pipeline?

I'd like to add $arrayref = decode_array_literal('{2,3}') and
maybe $hashref = decode_hstore_literal('x=>1, y=>2').
I don't know how much works would be involved in those though.

Another possible improvement would be rewriting encode_array_literal()
in C, so returning arrays would be much faster.

I'd also like to #define PERL_NO_GET_CONTEXT, which would give a useful
performance boost by avoiding all the many hidden calls to lookup
thread-local storage. (PERL_SET_CONTEXT() would go and instead the
'currrent interpreter' would be passed around as an extra argument.)
That's a fairly mechanical change but the diff may be quite large.

Tim.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: unlogged tables
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: plperlu problem with utf8