Mary Anderson wrote: > Hi All, > > I have an 800 line ActivePerl cgi script which I am running under > WindowsXP, IIS on my local machine. It connects to a MySQL database, which > does not seem to be the problem. I enter data, send it to a review screen, > then save it to the database. The first few records enter with no problem > - screens come up filled with the information right away. However, as my > session continutes, the performance degrades dramatically. The application > will switch to the new page, tell me it is fetching data from the local > host, and take a minute or more to complete the screen. I don't know what > is going on -- I don't think it is the time used to interpret the code > because the first few records are processed in a reasonable amount of time. > > I would try using mod_perl, but that is an Apache piece of software.
So debug it and find out where the problem is. You could start by opening a log file to write your debug to and maybe intersperse time hacks before and after each area that may be using up time. You could use Win32::GetTickCount or Time::HiRes qw(gettimeofday tv_interval) to do the time hacks. EG: use Win32::GetTickCount; my $before; my $timing = 0; open DBG, ">$dbgfile" or die "create $dbgfile: $! ($^E)"; # thing you want to time : $before = Win32::GetTickCount () if $timing; my_sub_that_does_stuff (); printf DBG "my_sub_that_does_stuff (): %.3f seconds\n", (Win32::GetTickCount () - $before) / 1000 if $timing; # or using HiRes instead: # use Time::HiRes qw(gettimeofday tv_interval); # my $before = [&gettimeofday ()]; # ... some code here # printf "my so-and-such code: %.3f seconds\n", tv_interval ($before); ... close DBG; exit; _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
