diff options
author | Eric Wong <e@80x24.org> | 2019-06-26 08:11:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-29 19:59:00 +0000 |
commit | 858ab5cfe5fffa6c5a4221a523db3682be8fae06 (patch) | |
tree | df705ad8eaadb1c940a5128630f40be4848047d0 /lib/PublicInbox/NNTP.pm | |
parent | f2eaf5c929e6a3891b55195cbcaba99d16424933 (diff) | |
download | public-inbox-858ab5cfe5fffa6c5a4221a523db3682be8fae06.tar.gz |
Doing this for HTTP cuts the memory usage of 10K idle-after-one-request HTTP clients from 92 MB to 47 MB. The savings over the equivalent NNTP change in commit 6f173864f5acac89769a67739b8c377510711d49, ("nntp: lazily allocate and stash rbuf") seems down to the size of HTTP requests and the fact HTTP is a client-sends-first protocol where as NNTP is server-sends-first.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 53e18281..0a053627 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -6,7 +6,7 @@ package PublicInbox::NNTP; use strict; use warnings; use base qw(PublicInbox::DS); -use fields qw(nntpd article rbuf ng); +use fields qw(nntpd article ng); use PublicInbox::Search; use PublicInbox::Msgmap; use PublicInbox::MID qw(mid_escape); @@ -985,11 +985,7 @@ sub event_step { return $self->close if $r < 0; my $len = bytes::length($$rbuf); return $self->close if ($len >= LINE_MAX); - if ($len) { - $self->{rbuf} = $rbuf; - } else { - delete $self->{rbuf}; - } + $self->rbuf_idle($rbuf); update_idle_time($self); # maybe there's more pipelined data, or we'll have |