Slaven Rezić > Parse-CPAN-Packages-Fast-0.06 > Parse::CPAN::Packages::Fast

Download:
Parse-CPAN-Packages-Fast-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.06   Source   Latest Release: Parse-CPAN-Packages-Fast-0.08

NAME ^

Parse::CPAN::Packages::Fast - parse CPAN's package index

SYNOPSIS ^

    use Parse::CPAN::Packages::Fast;

    my $p = Parse::CPAN::Packages::Fast->new("/path/to/02packages.details.txt.gz");
    ## Or alternatively, if CPAN.pm is configured
    #my $p = Parse::CPAN::Packages::Fast->new;

    my $m = $p->package("Kwalify");
    # $m is a Parse::CPAN::Packages::Fast::Package object
    print $m->package, "\n";   # Kwalify
    print $m->version, "\n";   # 1.21

    my $d = $m->distribution;
    # $d is a Parse::CPAN::Packages::Fast::Distribution object
    print $d->dist,    "\n";   # Kwalify
    print $d->version, "\n";   # 1.21

DESCRIPTION ^

This is a largely API compatible rewrite of Parse::CPAN::Packages.

Notable differences are

WHY?

Calling Parse::CPAN::Packages' constructor is quite slow and takes about 10 seconds on my machine. In contrast, the reimplementation just takes a second.

I did some benchmarking of the original module and found no obvious weak point to speed it up. Moose is used here, but does not seem to cause the problem. I suspect that the real problem is just heavy use of method calls.

Also, this module does not have problems with circular references like the original. See "BUGS" in Parse::CPAN::Packages.

SEE ALSO ^

Parse::CPAN::Packages, CPAN::DistnameInfo.

syntax highlighting: