user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: "Eric Wong (Contractor, The Linux Foundation)" <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 7/9] view: drop load_results
Date: Fri, 30 Mar 2018 01:20:46 +0000	[thread overview]
Message-ID: <20180330012048.15985-8-e@80x24.org> (raw)
In-Reply-To: <20180330012048.15985-1-e@80x24.org>

It's no longer necessary to have this since load_expand
now populates $smsg->mid with the "preferred" Message-ID.
This saves around 10ms on the homepage for me.
---
 lib/PublicInbox/View.pm | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 60fc1df..c151f22 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -409,7 +409,7 @@ sub thread_html {
 	my $mid = $ctx->{mid};
 	my $srch = $ctx->{srch};
 	my $sres = $srch->get_thread($mid);
-	my $msgs = load_results($srch, $sres);
+	my $msgs = $sres->{msgs};
 	my $nr = $sres->{total};
 	return missing_thread($ctx) if $nr == 0;
 	my $skel = '<hr><pre>';
@@ -680,7 +680,7 @@ sub thread_skel {
 	$ctx->{prev_attr} = '';
 	$ctx->{prev_level} = 0;
 	$ctx->{dst} = $dst;
-	$sres = load_results($srch, $sres);
+	$sres = $sres->{msgs};
 
 	# reduce hash lookups in skel_dump
 	my $ibx = $ctx->{-inbox};
@@ -801,12 +801,6 @@ sub indent_for {
 	$level ? INDENT x ($level - 1) : '';
 }
 
-sub load_results {
-	my ($srch, $sres) = @_;
-	my $msgs = delete $sres->{msgs};
-	$srch->retry_reopen(sub { [ map { $_->mid; $_ } @$msgs ] });
-}
-
 sub thread_results {
 	my ($ctx, $msgs) = @_;
 	require PublicInbox::SearchThread;
@@ -1088,9 +1082,9 @@ sub index_topics {
 	}
 
 	my $sres = $srch->query($qs, $opts);
-	my $nr = scalar @{$sres->{msgs}};
+	$sres = $sres->{msgs};
+	my $nr = scalar @$sres;
 	if ($nr) {
-		$sres = load_results($srch, $sres);
 		walk_thread(thread_results($ctx, $sres), $ctx, *acc_topic);
 	}
 	$ctx->{-next_o} = $off + $nr;
-- 
EW


  parent reply	other threads:[~2018-03-30  1:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  1:20 [PATCH 0/9] minor tweaks and fixes Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 1/9] search: warn on reopens and die on total failure Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 2/9] v2writable: allow gaps in git partitions Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 3/9] v2writable: convert some fatal reindex errors to warnings Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 4/9] wwwstream: flesh out clone instructions for v2 Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 5/9] v2writable: go backwards through alternate Message-IDs Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 6/9] view: speed up homepage loading time with date clamp Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` Eric Wong (Contractor, The Linux Foundation) [this message]
2018-03-30  1:20 ` [PATCH 8/9] msgtime: parse 3-digit years properly Eric Wong (Contractor, The Linux Foundation)
2018-03-30  1:20 ` [PATCH 9/9] feed: optimize query for feeds, too Eric Wong (Contractor, The Linux Foundation)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180330012048.15985-8-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).