Re: Performance of c, pl/perl, pl/pgsql - Mailing list pgsql-general

From Joel Burton
Subject Re: Performance of c, pl/perl, pl/pgsql
Date
Msg-id Pine.LNX.4.21.0104300919590.6719-100000@olympus.scw.org
Whole thread Raw
In response to Performance of c, pl/perl, pl/pgsql  (Einar Karttunen <ekarttun@cs.Helsinki.FI>)
List pgsql-general
On Mon, 30 Apr 2001, Einar Karttunen wrote:

> Hello
>
> Has anyone benchmarked how slow/fast the procedural languages are. I know
> that pl/perl is probably faster than pl/pgsql. But how much? How much
> faster are native c-functions...
>
> ps. Is there any good documentation on pl/perl. The programmers manual
> didn't have much information.

No, pl/perl is slower than pl/pgsql: that is, the overhead of calling it
for simple functions is more (about 30% more, in some very simple testing
I did.) However, since perl has so many built-in fucntions (regexs, great
string handling, etc.) any real function that does anything slightly
complex should be a great deal faster than pl/pgsql. A pretty
straightfoward hash an organization name to their acronym function was
about 40% faster in pl/perl.

The only native C functions I had to test were the simple ones that come
w/PostgreSQL (min(), max(), etc.) They were about twice as fast as a
straigtforward plpgsql replacement.

Again, take these numbers w/a big grain of salt -- these were off-the-cuff
tests I did out of curiosity.

You can refer to my posting ~2 weeks ago for more info.

--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


pgsql-general by date:

Previous
From: Zak McGregor
Date:
Subject: System catalogues
Next
From: "Eric G. Miller"
Date:
Subject: Re: running pgaccess on localhost