NateTut has asked for the wisdom of the Perl Monks concerning the following question:

I've been playing around with PPM::Repositories and it seems to work OK (although PPM::AddRepository() didn't), but some repositories are faster than others. When they are all added to ppm searches SLOW WAY DOWN.

What I'm contemplating is a way to test the site before adding it so I don't add any dogs. Here is what I have so far (just lists the repositories) what I need are ideas on testing repository response time.

Thanks
use strict; use warnings; use PPM; use PPM::Repositories; # # Print out all *Active* repositories for perl 5.8.x # for my $rep ( keys %Repositories ) { next unless $Repositories{$rep}->{Active}; next unless grep { $_ == 5.8 } @{ $Repositories{$rep}->{PerlV} }; print("rep add $rep $Repositories{$rep}->{location}\n"); }
Update:
Since these are just web sites are there any HTTP modules that might help?

Replies are listed 'Best First'.
Re: Testing a PPM Repository for Speed
by CountZero (Bishop) on Apr 05, 2006 at 21:21 UTC
    Interesting, but as with all things on the Internet, sometimes it's fast, sometimes it slows down to a crawl and there is no rhyme or reason to it, so you would really need to run your speed test many times and average over it.

    I would run a PPM::InstallPackage(``package'' => $package, ``location'' => $location, ``root'' => $root); command on each of your repositories, noting the time it took to finish it and then remove (PPM::RemovePackage(``package'' => $package, ``force'' => $force)) the package again before testing the next repo.

    Other than the download speed, you should also test the search speed of the repository, but strangely enough I did not find an obvious function for it ???

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Testing a PPM Repository for Speed
by randyk (Parson) on Apr 06, 2006 at 00:15 UTC

    Repositories that have summary.ppm and searchsummary.ppm summary files of available packages, and use those for searches, will be noticeably faster. The PPM distribution on CPAN has an example of how to set this up.

Re: Testing a PPM Repository for Speed
by QM (Parson) on Apr 06, 2006 at 02:51 UTC
    Could you rewrite ppm3? to use fork/thread, and check all the repositories simultaneously? Would this help?

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Re: Testing a PPM Repository for Speed
by NateTut (Deacon) on Apr 06, 2006 at 14:20 UTC
    Thanks for the tips!