Author: kwilliams
Date: Sun Jul 2 20:12:30 2006
New Revision: 6612
Modified:
Module-Build/trunk/lib/Module/Build/Base.pm
Log:
Speed up execution of find_pods by catering to File::Spec's and Cwd's
peculiarities. This produces about a factor of 3 speedup in building
M::B itself (from about 3.5 seconds down to 1.2 seconds on my
machine), which would probably be more noticeable for much larger
distributions.
Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Sun Jul 2 20:12:30 2006
@@ -2441,8 +2441,11 @@
my ($self, $dirs, %args) = @_;
my %files;
foreach my $spec (@$dirs) {
- my $dir = $self->localize_dir_path($spec);
+ # Run through rel2abs() because abs2rel() will do the same thing
+ # anyway - faster to just do it up front.
+ my $dir = File::Spec->rel2abs( $self->localize_dir_path($spec) );
next unless -e $dir;
+
FILE: foreach my $file ( @{ $self->rscan_dir( $dir ) } ) {
foreach my $regexp ( @{ $args{exclude} } ) {
next FILE if $file =~ $regexp;