X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6DBE6D7219 for ; Sun, 21 Aug 2005 21:20:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07785-05 for ; Mon, 22 Aug 2005 00:19:58 +0000 (GMT) Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id E26CCD71F8 for ; Sun, 21 Aug 2005 21:19:57 -0300 (ADT) Received: (qmail 28205 invoked from network); 22 Aug 2005 00:20:00 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 22 Aug 2005 00:20:00 -0000 From: "Greg Sabino Mullane" To: pgsql-interfaces@postgresql.org Subject: Re: DBD::Pg performance bites compared to DBD::mysql? X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <1015.1117775836@sss.pgh.pa.us> Date: Mon, 22 Aug 2005 00:20:00 -0000 X-Mailer: JoyMail 1.48 Message-ID: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.104 required=5 tests=[AWL=0.104] X-Spam-Level: X-Archive-Number: 200508/35 X-Sequence-Number: 5706 -----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-----