pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-interfaces@postgresql.org
Subject: Re: DBD::Pg performance bites compared to DBD::mysql?
Date: Mon, 22 Aug 2005 00:20:00 -0000
Message-ID: <e8701beb659e7207431e08c37b69bcaf@biglumber.com> (raw)
In-Reply-To: <1015.1117775836@sss.pgh.pa.us>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I'm not any kind of Perl module guru, but it looks to me like the
> explanation for the discrepancy is that much of DBD::mysql is written
> in C while the equivalent code in DBD::Pg is written in Perl.  This is
> killing us for any app written in Perl :-( --- the above trace only
> shows a factor of 2 total penalty, but I've seen up to a factor of 4 in
> other cases.  There is no way that a client-side driver should be taking
> several times longer than the backend to process a SQL command :-(
>
> Can anyone who knows more about Perl confirm or deny?
> Anyone want to step up to fix it?

I can't imagine that it was causing a factor of 2 difference, but I've
changed the code in DBD::Pg to make do() a lot smarter, for brain-dead
benchmarks such as MySQL's that use do() instead of prepare/execute
like they should. In short, DBD::Pg will short-circuit a lot of the usual
work and call PQexec directly if it can get away with it, which should
make the profile Tom posted look a lot better. It also avoids overhead of
going through Pg.pm, and is all C/XS code now. Hopefully, this should
make the benchmarking results a little more fair. :) This is now in
cvs, and will be part of the upcoming version 1.44 of DBD::Pg.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200508212016
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFDCRoBvJuQZxSWSsgRAlb7AJ9IfY1fmxRoib1Bct4HCHRi6WoCCwCfQjmk
oqhEPn8SzwcEe9SouwEUD2s=
=eKgZ
-----END PGP SIGNATURE-----





view thread (9+ messages)  latest in thread

Message-ID: <e8701beb659e7207431e08c37b69bcaf@biglumber.com>
Permalink:  ../e8701beb659e7207431e08c37b69bcaf@biglumber.com/
Also on:    postgresql.org/message-id/e8701beb659e7207431e08c37b69bcaf@biglumber.com

 · 

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: greg@turnstep.com
  Subject: Re: DBD::Pg performance bites compared to DBD::mysql?
  In-Reply-To: <e8701beb659e7207431e08c37b69bcaf@biglumber.com>

* 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