On Mon, Oct 20, 2003 at 12:24:14PM -0700, Ovid wrote:
> --- Tels <[EMAIL PROTECTED]> wrote:
> > Well, still it would be good to improve the speed of Devel::Cover,
> > on my box (lowly 500 Mhz, yes, I could upgrade to 2 Ghz AMD or so :)
> > a particulary project takes 33 minutes for one run... not exactly
> > what I call "interactive"
> > :)
> 
> Frankly, I think some major work could be done here.

I agree.  Without more details it is hard to tell, but in my experience
the majority of the resources used on reasonably sized examples are
expended in "database" manipulation, specifically in reading, merging
and writing databases.

I wrote "database" in quotes because currently we are talking about a
flat file, written using Data::Dumper and eval'd in.  I have considered
other options - specifically YAML and Storable.  I have found YAML to be
even slower and too buggy, and Storable to less reliable.  (I never
tracked down specific problems.)  This in an area that needs to be
addressed.

>                                                       In an attempt to
> eliminate the problem I had, I wrote a quick program that recursed
> through directories and ran the tests that it found there.  The core
> of the loop was something like this:
> 
>   my $count = 1;
>   my $total = @test_dirs;
>   foreach my $dir (@test_dirs) {
>     printf "\nProcessing %3d out of %3d:  $dir\n\n", $count, $total;
>     chdir $dir;
>     my $command = 'perl -MDevel::Cover=-db,/home/ovid/cover_db /usr/bin/rtk_test";
>     system($command);
>     $count++;
>   }

I would suggest that the first thing to do would be to limit coverage
collected to statement cover.  Until that's at a reasonable level the
rest of the code coverage metrics are of little use.

> There were 92 test directories in @test_dirs.  By the time I got to
> the fourth directory, I had a 45 megabyte coverage database and the
> output of top was:
> 
>     PID USER   PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
>   22348 cxp     18   0 1133M 1.1G 19280 R    99.9 55.5  30:29 perl

At least you haven't run out of memory yet ;-)

> Needless to say, I killed the tests.  I've never dug into the
> internals of Devel::Cover so I don't know how easy it would be to fix
> this (and maybe there's something really silly that I've overlooked).
> Unless I get very lucky, I think the code coverage project here is
> dead.

Try limiting coverage to statement cover and see if that salvages
anything.

Another possibility is to write separate databases, and see if any of
them are exceptionally large, then use the cover program to merge them.

Don't give up _just_ yet.  I'd like to try to help you get some value
from Devel::Cover.  But do remember, I've never called it anything other
than alpha.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to