Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection; - Mailing list pgsql-hackers

From Oleg Serov
Subject Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;
Date
Msg-id cec7c6df0811160159l5b942d53jb208e947bcf650bd@mail.gmail.com
Whole thread Raw
In response to Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;  ("Oleg Serov" <serovov@gmail.com>)
List pgsql-hackers
Why pl/pgsql doesn't have this effect ?

2008/11/16 Andrew Dunstan <andrew@dunslane.net>:
>
>
> Oleg Serov wrote:
>>
>> When perl function executes first time, it is too slowly, but if
>> execute perl function(not function which executed first time) again it
>> runs in 1000 times faster. Why ? how can i optimize it ?
>> Configure shared_preload_libraries = '$libdir/plperl' or
>> local_preload_libraries = '$libdir/plugins/plperl' does not help;
>>
>>
>
> The function is recompiled on the first call in each backend. (The same is
> true of most PLs, BTW, it's not a perl-only problem.) There is no immediate
> cure, unfortunately. Using pooled connections might help to mitigate the
> effect.
>
> One might imagine providing for certain functions to be loaded on backend
> startup, or even (where we aren't using BACKEND_EXEC) on postmaster start.
> But that would be a new feature, and we are past feature freeze for the
> upcoming release, so it's not going to happen any time soon.
>
> cheers
>
> andrrew
>


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Compiling on HP-UX 10.20 fails
Next
From: "Fujii Masao"
Date:
Subject: Re: Synchronous replication patch v2