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

Being particularly lazy at the moment, and waiting for yet another PPM query, I wonder what it would take to speed up the PPM Search And Rescue Team?

Does it make sense to rewrite PPM(3?) to fork off child processes and query multiple repositories at once?

Is the problem in the number of repositories in my queue (10)?

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

Replies are listed 'Best First'.
Re: Speeding Up PPM
by holli (Abbot) on Apr 11, 2006 at 09:37 UTC
      Thanks holli. I bet you didn't notice this upgrade I added to the thread ;)

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

        ouch ;)


        holli, /regexed monk/
Re: Speeding Up PPM
by Corion (Patriarch) on Apr 11, 2006 at 06:31 UTC

    I'd guess that it's not the number of repositories, but that you have one slow repository at the front of your queue. I greatly reduced the time I have to wait for CPAN queries by setting up a local mirror via CPAN::Mini - maybe you can do the same for PPM and set up a local repository mirror to speed up your searches.

      I'd guess that it's not the number of repositories, but that you have one slow repository at the front of your queue.
      That's probably true. I should do some tests, and maybe put a timeout in there for slow repositories.

      I should also look into forking, but I don't have the time now.

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

Re: Speeding Up PPM
by spiritway (Vicar) on Apr 11, 2006 at 09:29 UTC

    If you're trying to update a module that doesn't exist, then your query will run through your 10 repositories, taking an inordinate amount of time. All you need are a couple of slow repositories to make the process slow down to a crawl. I had much the same problem as you - there's always someone out there who's moving slowly, and the more repositories you query, the more likely you'll hit a slow one (or more). I now use only two, and this works quite well for me.

Re: Speeding Up PPM
by QM (Parson) on Apr 12, 2006 at 03:20 UTC
    While playing around with timing some things, I discovered that one of the repositories has a bad PPM::Repositories. ppm returns with this:
    PPM::PPD::init: not a PPD and not a file: <!-- BEGIN kwiki_screen --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/T +R/xhtml1/DTD/xhtml11.dtd"> <!-- BEGIN kwiki_screen.html --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" / +> <title> [snip]

    I tried to chase it down, through ppm, ppm3, and ppm3-bin. From the perldoc on ppm3-bin:

    SYNOPSIS Do not run *ppm3-bin* manually. It is meant to be called by the wr +apper program *ppm3*. See ppm3.
    Gee. Considering that all ppm3 does is set some environment variables and call ppm3-bin, what to do?

    I played with the repository order with rep up, and finally nailed it down to datetime. According to the Wayback Machine, there were ppd files, but not in a repository format. (But I could be mistaken.)

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