From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2D10C1FD58 for ; Sat, 11 Jan 2020 22:35:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 7/9] xt/git_async_cmp: do not slurp large OID list into memory Date: Sat, 11 Jan 2020 22:35:01 +0000 Message-Id: <20200111223503.24473-8-e@yhbt.net> In-Reply-To: <20200111223503.24473-1-e@yhbt.net> References: <20200111223503.24473-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I somehow thought "foreach (<$cat>)" could work like "while (<$cat>)" when it came to iterating over file handles... --- xt/git_async_cmp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t index f8ffe3d9..18fce3db 100644 --- a/xt/git_async_cmp.t +++ b/xt/git_async_cmp.t @@ -27,7 +27,7 @@ my $async = timeit($nr, sub { my $cat = $git->popen(@cat); $git->cat_async_begin; - foreach (<$cat>) { + while (<$cat>) { my ($oid, undef, undef) = split(/ /); $git->cat_async($oid, $cb); } @@ -39,7 +39,7 @@ my $async = timeit($nr, sub { my $sync = timeit($nr, sub { my $dig = Digest::SHA->new(1); my $cat = $git->popen(@cat); - foreach (<$cat>) { + while (<$cat>) { my ($oid, undef, undef) = split(/ /); my $bref = $git->cat_file($oid); $dig->add($$bref);