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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 296CC1F621 for ; Sat, 10 Sep 2022 08:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662797933; bh=FKWJh492pxLK3ArVhnrLepP/kgPGWlO7ssl/Gd766as=; h=From:To:Subject:Date:In-Reply-To:References:From; b=2qB2q7A+vUfvukg0biMRf+Y+46BAE5f8jEA1itIr7qy0fQaB/dOIpev32K/hOYek2 Jjk5xpkazy/iu6nfdLr2lJ6odEDI34gCL8nndjRDw/x0ojtkHH8AgG9+B6GisLooAP M4O4g4CFSf0EOFgWRtRqF5E0EiqFWnc36XSN+Mdw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 08/38] www_listing: consolidate some ->zmore dispatches Date: Sat, 10 Sep 2022 08:16:59 +0000 Message-Id: <20220910081729.2011934-9-e@80x24.org> In-Reply-To: <20220910081729.2011934-1-e@80x24.org> References: <20220910081729.2011934-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: `.' concatenation is still faster for small strings, but passing an array to ->zmore is more efficient for large search results and full listings. --- lib/PublicInbox/WwwListing.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 79c0a8ec..0ab41452 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -223,13 +223,12 @@ sub psgi_triple { @$list = map { $_->[1] } sort { $b->[0] <=> $a->[0] } @$list; } - $gzf->zmore('
');
-		$gzf->zmore(join("\n", @$list));
+		$gzf->zmore('
', join("\n", @$list)); # big
 		$gzf->zmore(mset_footer($ctx, $mset)) if $mset;
 	} elsif (my $mset = delete $ctx->{-mset}) {
-		$gzf->zmore(mset_nav_top($ctx, $mset));
-		$gzf->zmore('
no matching inboxes');
-		$gzf->zmore(mset_footer($ctx, $mset));
+		$gzf->zmore(mset_nav_top($ctx, $mset) .
+				'
no matching inboxes' .
+				mset_footer($ctx, $mset));
 	} else {
 		$gzf->zmore('
no inboxes, yet');
 	}