diff options
author | Eric Wong <e@80x24.org> | 2016-10-05 23:47:21 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-10-05 23:52:52 +0000 |
commit | 712b8bb3a61cc261a4b8c1bfdb6e39f40cee3188 (patch) | |
tree | ffa0c554745e97eb0c518c6b21ffc609a43f3145 /lib/PublicInbox/SearchView.pm | |
parent | 857f94304d12ded130300a36378e1a9d7feee4a3 (diff) | |
download | public-inbox-712b8bb3a61cc261a4b8c1bfdb6e39f40cee3188.tar.gz |
This roughly doubles performance due to the reduction in object creation and abstraction layers.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r-- | lib/PublicInbox/SearchView.pm | 8 |
1 files changed, 3 insertions, 5 deletions
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); |