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 2/7] searchmsg: get rid of termlist scanning for mid
  2019-01-10 21:35  5% [PATCH 0/7] psgi: more memory reductions Eric Wong
@ 2019-01-10 21:35  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-01-10 21:35 UTC (permalink / raw)
  To: meta

It doesn't seem to be used anywhere
---
 lib/PublicInbox/SearchMsg.pm | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm
index c7787ea..5a2ca83 100644
--- a/lib/PublicInbox/SearchMsg.pm
+++ b/lib/PublicInbox/SearchMsg.pm
@@ -157,29 +157,17 @@ sub references {
 	defined $x ? $x : '';
 }
 
-sub _get_term_val ($$$) {
-	my ($self, $pfx, $re) = @_;
-	my $doc = $self->{doc};
-	my $end = $doc->termlist_end;
-	my $i = $doc->termlist_begin;
-	$i->skip_to($pfx);
-	if ($i != $end) {
-		my $val = $i->get_termname;
-		$val =~ s/$re// and return $val;
-	}
-	undef;
-}
-
 sub mid ($;$) {
 	my ($self, $mid) = @_;
 
 	if (defined $mid) {
 		$self->{mid} = $mid;
-	} elsif (my $rv = $self->{mid}) {
+	} elsif (defined(my $rv = $self->{mid})) {
 		$rv;
 	} elsif ($self->{doc}) {
-		$self->{mid} = _get_term_val($self, 'Q', qr/\AQ/);
+		die "SHOULD NOT HAPPEN\n";
 	} else {
+		die "NO {mime} for mid\n" unless $self->{mime};
 		$self->_extract_mid; # v1 w/o Xapian
 	}
 }
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/7] psgi: more memory reductions
@ 2019-01-10 21:35  5% Eric Wong
  2019-01-10 21:35  7% ` [PATCH 2/7] searchmsg: get rid of termlist scanning for mid Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-01-10 21:35 UTC (permalink / raw)
  To: meta

While of these are as significant as the patch avoid inadvertant
MIME objects storage in threads(*), they add up to some meaningful
reductions and can make it easier for memory-starved VPS to serve
serve public-inboxes.

I've diffed output of /T/, /t/ and &x=t endpoints of various HTML
pages before and after without finding differences.

There's definitely more that can be done in this area, though...

Sprinkling Devel::Size::total_size calls in various places (mostly
->getline iterators/callbacks ) was instrumental in the development
of these patches.

(*) https://public-inbox.org/meta/20190108004606.23760-1-e@80x24.org/
    ("view: stop storing all MIME objects on large threads")

Eric Wong (7):
  httpd: remove psgix.harakiri reference
  searchmsg: get rid of termlist scanning for mid
  searchmsg: remove Xapian::Document field
  searchview: drop unused {seen} hashref
  searchmsg: remove unused fields for PSGI in Xapian results
  over: cull unneeded fields for get_thread
  view: more culling for search threads

 lib/PublicInbox/HTTPD.pm        |  1 -
 lib/PublicInbox/Inbox.pm        |  5 ++--
 lib/PublicInbox/Over.pm         | 19 ++++++++-----
 lib/PublicInbox/SearchIdx.pm    |  6 ++--
 lib/PublicInbox/SearchMsg.pm    | 49 ++++++++++++++++-----------------
 lib/PublicInbox/SearchThread.pm |  5 ++++
 lib/PublicInbox/SearchView.pm   |  1 -
 lib/PublicInbox/View.pm         | 10 +++++--
 t/search.t                      | 10 ++++---
 9 files changed, 60 insertions(+), 46 deletions(-)

-- 
EW


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-01-10 21:35  5% [PATCH 0/7] psgi: more memory reductions Eric Wong
2019-01-10 21:35  7% ` [PATCH 2/7] searchmsg: get rid of termlist scanning for mid 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).