From fea10eefe36c3f759aa2e5a7b5b61a58df1c3b4a Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 19 Nov 2018 10:33:19 +0100 Subject: Use zcat instead of IO::Zlib Apparently IO::Zlib is quite slow compared to zcat and other modules aren't supposed to be much faster. Also this gives us free multithreading. Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools/CPAN.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/App/ArchLinux/PackagerTools/CPAN.pm b/lib/App/ArchLinux/PackagerTools/CPAN.pm index 0bf201f..4faf0d6 100644 --- a/lib/App/ArchLinux/PackagerTools/CPAN.pm +++ b/lib/App/ArchLinux/PackagerTools/CPAN.pm @@ -6,7 +6,6 @@ use CPAN::DistnameInfo; use CPANPLUS::Backend; use Carp; use Function::Parameters; -use IO::Zlib; use Log::Any qw($log); use Syntax::Keyword::Try; use version; @@ -140,7 +139,7 @@ method _build_dist_index() { $log->debug("Building index..."); my $packages_file = "$ENV{HOME}/.cpanplus/02packages.details.txt.gz"; - my $fh = IO::Zlib->new($packages_file, 'r'); + open my $fh, '-|', 'zcat', $packages_file; my %seen; my $line_number = 0; while (<$fh>) { -- cgit v1.2.3-24-g4f1b