]> Sergey Matveev's repositories - public-inbox.git/commit
nntp: small speed up for multi-line responses
authorEric Wong <e@80x24.org>
Fri, 4 Dec 2020 22:03:46 +0000 (22:03 +0000)
committerEric Wong <e@80x24.org>
Sat, 5 Dec 2020 21:41:52 +0000 (21:41 +0000)
commit726d6e71aee5d974615fa8097a482382a5064e5d
tree5c88abd24ea4b67f0eb246bbb23b8d99ea029373
parent0a80d0c2e723213e3981d2d6ef0de7cee60ee50c
nntp: small speed up for multi-line responses

Using a non-zero-length separator for `join' requires extra work
inside Perl.  We can shove the cost of appending "\r\n" into the
`map' loop, instead.  This speeds up the `join' operation.

The "deferred" log entry for a "LISTGROUP org.kernel.vger.linux-kernel"
command (with nearly 3.8 million messages) goes from ~3.96s to 3.86s
on my workstation.
lib/PublicInbox/NNTP.pm