]> Sergey Matveev's repositories - public-inbox.git/commit
www: use PerlIO::scalar (zfh) for buffering
authorEric Wong <e@80x24.org>
Sat, 10 Sep 2022 08:17:19 +0000 (08:17 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Sep 2022 19:50:48 +0000 (19:50 +0000)
commitab9c03ff4aa369b397dc1a8c8936153c8565fd05
tree8bc61ae89d8f967ea948918d0478db291011d159
parentf32456e0d0f4a7756fcc17c83ccf5b682cb512d9
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
lib/PublicInbox/GzipFilter.pm
lib/PublicInbox/Mbox.pm
lib/PublicInbox/SearchView.pm
lib/PublicInbox/View.pm
lib/PublicInbox/ViewDiff.pm
lib/PublicInbox/WwwAtomStream.pm
lib/PublicInbox/WwwStream.pm