From 12a21ee5bbde99ae5273f777aaf5e3c606b69729 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 4 Mar 2017 00:15:30 +0100 Subject: Borg::list_archive: Use open() instead of IPC::Run for performance Surprisingly the callback isn't actually that bad, but IPC::Run (probably new_chunker) adds quite some overhead. Since open supports everything we need, use that instead. Signed-off-by: Florian Pritz --- lib/App/BorgRestore.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/App/BorgRestore.pm') diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index 1fb5124..4ca2716 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -314,7 +314,7 @@ sub handle_added_archives { $self->debug(sprintf("Adding archive %s", $archive)); - my $proc = $self->{borg}->list_archive($archive, sub { + $self->{borg}->list_archive($archive, sub { my $line = shift; # roll our own parsing of timestamps for speed since we will be parsing # a huge number of lines here @@ -325,7 +325,6 @@ sub handle_added_archives { $self->add_path_to_hash($lookuptable, $+{path}, $time); } }); - $proc->finish() or die "borg list returned $?"; $self->debug(sprintf("Finished parsing borg output after %.5fs. Adding to db", Time::HiRes::gettimeofday - $start)); -- cgit v1.2.3-24-g4f1b