Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;

From: "Oleg Serov" <serovov(at)gmail(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;
Date: 2008-11-16 19:35:16
Message-ID: cec7c6df0811161135r5bddb167ibde777099090e70b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So, how i must optimize it?

2008/11/16 Andrew Dunstan <andrew(at)dunslane(dot)net>:
>
>
> Tom Lane wrote:
>>
>> I wrote:
>>
>>>
>>> On my Fedora 9 machine, the overhead to start plperl seems to be about
>>> 40 msec. This compares unfavorably to the time to start perl from the
>>> command line, which is under 4 msec. I see that /usr/bin/perl pulls in
>>> libperl.so, so it's paying the same shlib overhead as we do. How is it
>>> that we take ten times longer to start up?
>>>
>>
>> The above number was for plperl in a SQL_ASCII database.
>> Some more data points:
>>
>> plperl plperlu
>>
>> SQL_ASCII 40 18
>> UTF8 67 18
>>
>> which leads to the conclusion that those random little startup things
>> plperl does are just unbelievably expensive.
>>
>>
>>
>
> I suspect much of this time is taken in loading perl modules, (strict, Safe,
> utf8, SPI among others), not in anything very special that we do.:
>
> andrew(at)constanza plperl]$ time perl -e ';'
>
> real 0m0.004s
> user 0m0.003s
> sys 0m0.001s
> [andrew(at)constanza plperl]$ time perl -e 'use strict; use Safe;use utf8;'
>
> real 0m0.053s
> user 0m0.016s
> sys 0m0.007s
>
> cheers
>
> andrew
>
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-16 19:43:59 Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;
Previous Message Jaime Casanova 2008-11-16 18:38:13 Re: CVS can't be built on mingw