Mohammed Khatib: # Can anyone advise me on more advanced testing techniques # which would reveal why the program takes as long as it # does to process XML files?
The Devel::DProf module might help: C:\>perl -d:DProf -e "sub a{1 for 0..10000} sub b{a for 0..100; 1 for 0..10000} b()" && dprofpp Total Elapsed Time = -0.00091 Seconds User+System Time = 0.488164 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 94.2 0.460 0.460 101 0.0046 0.0045 main::a 2.05 0.010 0.469 1 0.0095 0.4691 main::b The %Time and (secondarily) #Calls lines will probably be the most useful in helping you figure out what subroutines you should focus your efforts on. Your ActivePerl distribution (or a normal Perl distribution, for that matter) contains full documentation on Devel::Dprof; the documentation for dprofpp, the tool used to analyze the data Devel::DProf produces, is also included with Perl. NAME Devel::DProf - a Perl code profiler SYNOPSIS perl5 -d:DProf test.pl DESCRIPTION The Devel::DProf package is a Perl code profiler. This will collect information on the execution time of a Perl script and of the subs in that script. This information can be used to determine which subroutines are using the most time and which subroutines are being called most often. This information can also be used to create an execution graph of the script, showing subroutine relationships. NAME dprofpp - display perl profile data SYNOPSIS dprofpp [-a|-z|-l|-v|-U] [-s|-r|-u] [-q] [-F] [-I|-E] [-O cnt] [-A] [- [-S] [-g subroutine] [profile] dprofpp -T [-F] [-g subroutine] [profile] dprofpp -t [-F] [-g subroutine] [profile] dprofpp -p script [-Q] [other opts] dprofpp -V [profile] DESCRIPTION The *dprofpp* command interprets profile data produced by a profiler, such as the Devel::DProf profiler. Dprofpp will read the file tmon.out and will display the 15 subroutines which are using the most time. By default the times for each subroutine are given exclusive of the times of their child subroutines. HTH, --Brent Dax <[EMAIL PROTECTED]> @roles=map {"Parrot $_"} qw(embedding regexen Configure) "If you want to propagate an outrageously evil idea, your conclusion must be brazenly clear, but your proof unintelligible." --Ayn Rand, explaining how today's philosophies came to be _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs