Обсуждение: Overhead of Pl/Perl ?

Поиск
Список
Период
Сортировка

Overhead of Pl/Perl ?

От
Jean-Denis Girard
Дата:
I would like to know what is the overhead of using Perl versus C in
terms of memory
consumption, speed...

I'm storing usernames / encrypted passords in a table and wrote this
ridiculous Pl/Perl
function:   CREATE FUNCTION "crypt" (text,text )   RETURNS bool AS 'return (crypt($_[0],$_[1]) eq $_[1]) ? 1:0;'
LANGUAGE'plperl'
 

in order to do things like:   select * from users where name='foo' and crypt(passwd, 'bar')

This is the only stored procedure I use in the database.
Is there any real life benefit in rewriting the function in C, and
loosing the simplicity of Perl ?

Thanks,
Jean-Denis Girard