From 712b8bb3a61cc261a4b8c1bfdb6e39f40cee3188 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Oct 2016 23:47:21 +0000 Subject: thread: remove Email::Abstract wrapping This roughly doubles performance due to the reduction in object creation and abstraction layers. --- lib/PublicInbox/SearchView.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 0d54c3df..ebeb41f7 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -148,7 +148,6 @@ sub mset_thread { my $i = $_; my $m = PublicInbox::SearchMsg->load_doc($i->get_document); $pct{$m->mid} = $i->get_percent; - $m = $m->mini_mime; $m; } ($mset->items); @@ -156,9 +155,9 @@ sub mset_thread { $th->thread; if ($q->{r}) { # order by relevance $th->order(sub { - [ sort { (eval { $pct{$b->topmost->messageid} } || 0) + [ sort { (eval { $pct{$b->topmost->{id}} } || 0) <=> - (eval { $pct{$a->topmost->messageid} } || 0) + (eval { $pct{$a->topmost->{id}} } || 0) } @{$_[0]} ]; }); } else { # order by time (default for threaded view) @@ -185,8 +184,7 @@ sub mset_thread { sub { return unless $msgs; while ($mime = shift @$msgs) { - my $mid = mid_clean(mid_mime($mime)); - $mime = $inbox->msg_by_mid($mid) and last; + $mime = $inbox->msg_by_smsg($mime) and last; } if ($mime) { $mime = Email::MIME->new($mime); -- cgit v1.2.3-24-ge0c7