From d0147582e289fdd4cdd84e91d8b0f8ae9c230124 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Apr 2020 09:28:49 +0000 Subject: searchthread: reduce indirection by removing container We can rid ourselves of a layer of indirection by subclassing PublicInbox::Smsg instead of using a container object to hold each $smsg. Furthermore, the `{id}' vs. `{mid}' field name confusion is eliminated. This reduces the size of the $rootset passed to walk_thread by around 15%, that is over 50K memory when rendering a /$INBOX/ landing page. --- lib/PublicInbox/SearchView.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 4fbf59ef..4336e4d9 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -243,8 +243,8 @@ sub search_nav_bot { sub sort_relevance { [ sort { - (eval { $b->topmost->{smsg}->{pct} } // 0) <=> - (eval { $a->topmost->{smsg}->{pct} } // 0) + (eval { $b->topmost->{pct} } // 0) <=> + (eval { $a->topmost->{pct} } // 0) } @{$_[0]} ] } -- cgit v1.2.3-24-ge0c7