user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 03/12] nntp: reduce syscalls for LIST OVERVIEW.FMT
  2015-09-30 21:00  6% [PATCH 0/12] another round of NNTP updates Eric Wong
@ 2015-09-30 21:00  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-09-30 21:00 UTC (permalink / raw)
  To: meta

No point in sending such a short, bounded response with
multiple syscalls.
---
 lib/PublicInbox/NNTP.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index faa7563..dc4227e 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -24,7 +24,7 @@ use constant {
 sub now () { clock_gettime(CLOCK_MONOTONIC) };
 
 my @OVERVIEW = qw(Subject From Date Message-ID References Bytes Lines);
-my %OVERVIEW = map { $_ => 1 } @OVERVIEW;
+my $OVERVIEW_FMT = join(":\r\n", @OVERVIEW) . ":\r\n";
 
 # disable commands with easy DoS potential:
 # LISTGROUP could get pretty bad, too...
@@ -90,9 +90,9 @@ sub cmd_xgtitle ($;$) {
 	'.'
 }
 
-sub list_overview_fmt ($$) {
+sub list_overview_fmt ($) {
 	my ($self) = @_;
-	more($self, $_ . ':') foreach @OVERVIEW;
+	do_more($self, $OVERVIEW_FMT);
 }
 
 sub list_active ($;$) {
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/12] another round of NNTP updates
@ 2015-09-30 21:00  6% Eric Wong
  2015-09-30 21:00  7% ` [PATCH 03/12] nntp: reduce syscalls for LIST OVERVIEW.FMT Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-09-30 21:00 UTC (permalink / raw)
  To: meta

This is probably performant enough for practical use :)

Eric Wong (12):
      search: remove get_subject_path
      nntp: HDR returns 225, not 224
      nntp: reduce syscalls for LIST OVERVIEW.FMT
      remove unnecessary fields usage
      daemon: always autoflush stdout/stderr
      nntpd: avoid lazy require
      INSTALL: document Danga::Socket dependency for nntpd
      nntp: MODE READER denies posting
      nntp: implement LIST HEADERS
      nntp: implement OVER/XOVER summary in search document
      t/nntpd.t: simplify condition for response termination
      t/nntpd.t: additional tests for XHDR/HDR

 INSTALL                       |   2 +
 lib/PublicInbox/Daemon.pm     |   3 +
 lib/PublicInbox/GitCatFile.pm |   5 +-
 lib/PublicInbox/Hval.pm       |   9 +--
 lib/PublicInbox/Mbox.pm       |  11 ++-
 lib/PublicInbox/Msgmap.pm     |   4 +-
 lib/PublicInbox/NNTP.pm       | 175 ++++++++++++++++++++----------------------
 lib/PublicInbox/NewsGroup.pm  |  25 +++---
 lib/PublicInbox/Search.pm     |  43 ++++++++---
 lib/PublicInbox/SearchIdx.pm  |  59 ++++++++++----
 lib/PublicInbox/SearchMsg.pm  |  86 +++++++++++++--------
 lib/PublicInbox/SearchView.pm |  19 ++---
 public-inbox-nntpd            |  19 +++--
 t/nntpd.t                     |  46 ++++++++++-
 t/search.t                    |   2 +-
 15 files changed, 305 insertions(+), 203 deletions(-)


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-30 21:00  6% [PATCH 0/12] another round of NNTP updates Eric Wong
2015-09-30 21:00  7% ` [PATCH 03/12] nntp: reduce syscalls for LIST OVERVIEW.FMT 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).