pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Denis Girard <jd-girard@esoft.pf>
To: pgsql-interfaces@postgresql.org <pgsql-interfaces@postgresql.org>
Subject: Overhead of Pl/Perl ?
Date: Tue, 27 Jun 2000 13:53:28 -1000
Message-ID: <39593E78.F113B0A6@esoft.pf> (raw)

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





Message-ID: <39593E78.F113B0A6@esoft.pf>
Permalink:  ../39593E78.F113B0A6@esoft.pf/
Also on:    postgresql.org/message-id/39593E78.F113B0A6@esoft.pf

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jd-girard@esoft.pf
  Subject: Re: Overhead of Pl/Perl ?
  In-Reply-To: <39593E78.F113B0A6@esoft.pf>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox