about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 08:17:18 +0000
committerEric Wong <e@80x24.org>2022-09-10 19:50:47 +0000
commitf32456e0d0f4a7756fcc17c83ccf5b682cb512d9 (patch)
treefee389d9d8a3830717834bba46860b22ed449756 /lib/PublicInbox/WwwStream.pm
parent3b3ee0a9d98e338c94d8ec90191bbe76faba0d87 (diff)
downloadpublic-inbox-f32456e0d0f4a7756fcc17c83ccf5b682cb512d9.tar.gz
This allows us to focus string concatenations in one place to
allow Perl internal scratchpad optimizations to reuse memory.

Calling Compress::Raw::Zlib::deflate repeatedly proves too
expensive in terms of CPU cycles.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r--lib/PublicInbox/WwwStream.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index c23668a4..2a318e5e 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -182,7 +182,7 @@ sub html_oneshot ($$;@) {
         bless $ctx, __PACKAGE__;
         $ctx->{gz} = PublicInbox::GzipFilter::gz_or_noop($res_hdr, $ctx->{env});
         $ctx->{base_url} // do {
-                $ctx->zmore(html_top($ctx));
+                $ctx->zadd(html_top($ctx));
                 $ctx->{base_url} = base_url($ctx);
         };
         my $bdy = $ctx->zflush(@_[2..$#_], _html_end($ctx));
@@ -216,7 +216,7 @@ sub html_init {
         my $h = $ctx->{-res_hdr} = ['Content-Type', 'text/html; charset=UTF-8'];
         $ctx->{gz} = PublicInbox::GzipFilter::gz_or_noop($h, $ctx->{env});
         bless $ctx, __PACKAGE__;
-        $ctx->zmore(html_top($ctx));
+        $ctx->zadd(html_top($ctx));
 }
 
 1;