]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_listing: consolidate some ->zmore dispatches
authorEric Wong <e@80x24.org>
Sat, 10 Sep 2022 08:16:59 +0000 (08:16 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Sep 2022 19:50:30 +0000 (19:50 +0000)
`.' 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

index 79c0a8ec209ff37081086f6a301114538e7a8ef4..0ab414522575483e0731ca7fc33657afbfe8f706 100644 (file)
@@ -223,13 +223,12 @@ sub psgi_triple {
                        @$list = map { $_->[1] }
                                sort { $b->[0] <=> $a->[0] } @$list;
                }
-               $gzf->zmore('<pre>');
-               $gzf->zmore(join("\n", @$list));
+               $gzf->zmore('<pre>', 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('<pre>no matching inboxes');
-               $gzf->zmore(mset_footer($ctx, $mset));
+               $gzf->zmore(mset_nav_top($ctx, $mset) .
+                               '<pre>no matching inboxes' .
+                               mset_footer($ctx, $mset));
        } else {
                $gzf->zmore('<pre>no inboxes, yet');
        }