Nobody ever claimed Perl is faster than C. Just more appropriate for certain kinds of jobs.
Have you tried setting $dbh->RowCacheSize? This can make a big different in bulk data operations. -Will -----Original Message----- From: Gerardo Santana Gómez Garrido [mailto:[EMAIL PROTECTED] Sent: Monday 04 July 2005 20:08 To: Jonathan Leffler Cc: [email protected]; [EMAIL PROTECTED] Subject: Re: it works, but... On 7/4/05, Jonathan Leffler <[EMAIL PROTECTED]> wrote: > Dear Gerardo, > > Perl + DBI + DBD::Informix imposes at least a moderate amount of > overhead compared with a raw ESQL/C program. Of course, it's reasonable, I'm aware of that. > Whether the time ratio you are seeing > is reasonable is slightly more debatable, but I would expect the Perl > combination to be slower. The big question for you is "is it too > slow?" Well, it was a surprise for me that DBD::Informix was more than twice slower. I'm proposing Perl as a substitute for coding reports (they are currently coded in ESQL/C and it is an unmaintable *mess*) and the processing time will not help me much. But even so, maintainability is a *strong* argument against waiting 2 more minutes. We'll see what the PHB says. The main reason I'm asking you about this issue is because I thought I did something wrong when building DBD::Informix, or there's probably a hack, or my system is broken,... or something. > And there's a subsidiary question - if you decide the answer is "yes; > it is too slow", then "is it cost-effective to write the application > in ESQL/C instead?" > > The other alternative is that you do the analysis and demonstrate > where the DBD::Informix code is unnecessarily slow (profiling, etc), > and you suggest ways to fix it. Patches are always welcome! OK, let's see what I can do. Just taking time from the project to "think" of rewriting reports is already a luxury, and there's a competing alternative called SQR. I have to test it too and see how much time it takes. Saludos > > > On 7/3/05, Gerardo Santana Gómez Garrido <[EMAIL PROTECTED] > > wrote: > > ---------- Forwarded message ---------- > > From: Gerardo Santana Gómez Garrido < [EMAIL PROTECTED]> > > Date: Jun 29, 2005 1:46 PM > > Subject: it works, but... > > To: [EMAIL PROTECTED] > > > > > > I'm sending you attached the output of it_works. > > > > DBD::Informix works fine, except that it's taking twice the time > > than ESQL/C when I SELECT from a table and do a while($ref = > > $stmt->fetch) { } > > > > This table has aprox. 250 fields and 8000 rows. It takes 199 seconds > > for perl to execute the select and fetch all the records, while for > > the program in ESQL/C (that selects, fetch, aggregates and prints a > > report) it takes 72 seconds. > > > > Any ideas? > > > > -- > Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h> > Guardian of DBD::Informix - v2005.01 - http://dbi.perl.org > "I don't suffer from insanity - I enjoy every minute of it." -- Gerardo Santana Gómez Garrido http://www.openbsd.org.mx/santana/ "Entre los individuos, como entre las naciones, el respeto al derecho ajeno es la paz" -Don Benito Juárez - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
