]> Sergey Matveev's repositories - public-inbox.git/commit
nntp: lazily allocate and stash rbuf
authorEric Wong <e@80x24.org>
Mon, 24 Jun 2019 02:52:50 +0000 (02:52 +0000)
committerEric Wong <e@80x24.org>
Mon, 24 Jun 2019 05:26:27 +0000 (05:26 +0000)
commit6f173864f5acac89769a67739b8c377510711d49
treeb20c9be3e0d6479dc78a81a76204069dfa1c2b8c
parent3667c96f84a39c8fbfaf4cef37f58a9db06bb4b3
nntp: lazily allocate and stash rbuf

Allocating a per-client buffer up front is unnecessary and
wastes a hash slot.  For the majority of (non-malicious)
clients, we won't need to store rbuf in a long-lived object
associated with a client socket at all.

This saves around 10M on 64-bit with 20K connected-but-idle
clients.
lib/PublicInbox/NNTP.pm