On Thu, Feb 03, 2005 at 10:18:43AM +0000, Tim Bunce wrote :
> On Thu, Feb 03, 2005 at 06:27:05PM +0900, [EMAIL PROTECTED] wrote:
> > Dear list,
> >
> > I wrote a simple CGI script using DBD::CSV on a linux
> > computer, and then installed it on a iMac G5. Its execution time is
> > now alomst 10 times slower. Using print instructions, I traced the
> > bottleneck to the following instruction :
> >
> > $sth->execute;
> >
> > Now I am a bit stuck, as I do not know how to investigate in
> > the DBD::CSV module to find where is the slow isnstruction.
>
> The Devel::DProf module (and/or other code profiling modules) may help.
>
Thank you for pointing this module. I have used it to analyse my script :
Total Elapsed Time = 63.19465 Seconds
User+System Time = 43.46465 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
66.5 28.91 36.463 109445 0.0003 0.0003 SQL::Statement::eval_where
11.1 4.848 6.132 109447 0.0000 0.0001 Text::CSV_XS::getline
7.96 3.458 3.458 218890 0.0000 0.0000 SQL::Statement::get_row_value
6.90 2.998 9.129 109447 0.0000 0.0001 DBD::CSV::Table::fetch_row
5.80 2.520 7.545 109445 0.0000 0.0001 SQL::Statement::process_predicate
4.36 1.894 1.894 109445 0.0000 0.0000 SQL::Statement::is_matched
2.95 1.284 1.284 109447 0.0000 0.0000 IO::Handle::getline
2.29 0.997 46.596 1 0.9965 46.595 SQL::Statement::SELECT
0.16 0.069 0.076 27 0.0026 0.0028 CGI::_compile
0.16 0.068 0.123 4 0.0170 0.0307 main::BEGIN
0.09 0.040 0.079 4 0.0099 0.0198 DBI::SQL::Nano::BEGIN
0.09 0.040 0.039 7 0.0057 0.0056 SQL::Statement::BEGIN
0.07 0.029 0.164 1 0.0295 0.1645 DBI::install_driver
0.02 0.010 0.010 1 0.0100 0.0100 Fcntl::bootstrap
0.02 0.010 0.010 1 0.0100 0.0100 SQL::Parser::dialect
It seems that there is no bottleneck. I have ran the script on
a 3GHz linux box, and it took it 19 seconds to complete. So I do not
understand how I mananaged to run it in 7 seconds on a 1.8 GHz Athlon
laptop (which unfortunately I do not own anymore).
As somebody kindly pointed me out that hardware differences
could have a strong impact on the results, I will suppose that this is
the reason why I have seen such speed inconsistencies, unless somebody
found something insightful in the dprofpp output extract in this mail.
Thanks to those who answered me and offered their help.
--
Charles