This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id:
54109
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
gfuji [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
(no value)
Fixed in:
(no value)



Subject: [PATCH] Improve Module::Build::Base::contains_pod(), which is a bottleneck
Hi, xdg. I have wrtie a patch to improve Module::Build::Base::contains_pod(), which is a bottleneck in the Build script. Regards, -- Goro Fuji (gfx) GFUJI at CPAN.org
Subject: cache-contains_pod.patch
Index: lib/Module/Build/Base.pm =================================================================== --- lib/Module/Build/Base.pm (revision 13772) +++ lib/Module/Build/Base.pm (working copy) @@ -3127,14 +3127,18 @@ sub contains_pod { my ($self, $file) = @_; - return '' unless -T $file; # Only look at text files + return $self->{_contains_pod}{$file} + if exists $self->{_contains_pod}{$file}; + + return $self->{_contains_pod}{$file} = '' if !-f $file; + my $fh = IO::File->new( $file ) or die "Can't open $file: $!"; - while (my $line = <$fh>) { - return 1 if $line =~ /^\=(?:head|pod|item)/; - } + binmode $fh; # for Win32 + local $/ = undef; # slurp - return ''; + return $self->{_contains_pod}{$file} + = <$fh> =~ /^ = (?: head | pod | item ) /xms; } sub ACTION_html {
Thank you. I hope one of the committers can get to this before too long.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.