user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/8] nntp: eliminate response-duration cyclic refs
@ 2019-12-21  7:59 Eric Wong
  2019-12-21  8:00 ` [PATCH 1/8] nntp: get_range: return scalarref for $beg Eric Wong
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Eric Wong @ 2019-12-21  7:59 UTC (permalink / raw)
  To: meta

While there are no known memory leaks in our code, the short-lived
reference cycle introduced by the long_response API is a potential
source of bugs.

Change the long_response API and update callers to pass
parameter explicitly to named subroutines instead of anonymous
ones.

Since creating new anonymous subs (aka "closures") take a fair
amount of memory in Perl, this ought to reduce memory pressure,
as well, since we're now only creating lightweight references to
long-lived subs.  The tradeoff is we make a few more hash
lookups since we no longer cache some hash lookups into local
variables onto the stack.

Eric Wong (8):
  nntp: get_range: return scalarref for $beg
  nntp: remove cyclic refs from long_response
  nntp: hdr_searchmsg: use named sub for numeric range response
  nntp: cmd_xrover: use named sub for long_response
  nntp: cmd_listgroup: use named subs for long_response
  nntp: cmd_newnews: use named sub for long_response
  nntp: hdr_msg_id: use named sub for long_response
  nntp: cmd_xover: use named sub for long_response

 lib/PublicInbox/NNTP.pm | 293 +++++++++++++++++++++-------------------
 1 file changed, 152 insertions(+), 141 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-12-21  8:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-21  7:59 [PATCH 0/8] nntp: eliminate response-duration cyclic refs Eric Wong
2019-12-21  8:00 ` [PATCH 1/8] nntp: get_range: return scalarref for $beg Eric Wong
2019-12-21  8:00 ` [PATCH 2/8] nntp: remove cyclic refs from long_response Eric Wong
2019-12-21  8:00 ` [PATCH 3/8] nntp: hdr_searchmsg: use named sub for numeric range response Eric Wong
2019-12-21  8:00 ` [PATCH 4/8] nntp: cmd_xrover: use named sub for long_response Eric Wong
2019-12-21  8:00 ` [PATCH 5/8] nntp: cmd_listgroup: use named subs " Eric Wong
2019-12-21  8:00 ` [PATCH 6/8] nntp: cmd_newnews: use named sub " Eric Wong
2019-12-21  8:00 ` [PATCH 7/8] nntp: hdr_msg_id: " Eric Wong
2019-12-21  8:00 ` [PATCH 8/8] nntp: cmd_xover: " Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).