From ab9c03ff4aa369b397dc1a8c8936153c8565fd05 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 10 Sep 2022 08:17:19 +0000 Subject: www: use PerlIO::scalar (zfh) for buffering Calling Compress::Raw::Zlib::deflate is fairly expensive. Relying on the `.=' (concat) operator inside ->zadd operator is faster, but the method dispatch overhead is noticeable compared to the original code where we had bare `.=' littered throughout. Fortunately, `print' and `say' with the PerlIO::scalar IO layer appears to offer better performance without high method dispatch overhead. This doesn't allow us to save as much memory as I originally hoped, but does allow us to rely less on concat operators in other places and just pass a list of args to `print' and `say' as a appropriate. This does reduce scratchpad use, however, allowing for large memory savings, and we still ->deflate every single $eml. --- Documentation/mknews.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/mknews.perl') diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl index 1936cea7..68866f44 100755 --- a/Documentation/mknews.perl +++ b/Documentation/mknews.perl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # Generates NEWS, NEWS.atom, and NEWS.html files using release emails # this uses unstable internal APIs of public-inbox, and this script @@ -46,6 +46,7 @@ if ($dst eq 'NEWS') { ibx => $ibx, -upfx => "$base_url/", -hr => 1, + zfh => $out, }; if ($dst eq 'NEWS.html') { html_start($out, $ctx); -- cgit v1.2.3-24-ge0c7