diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-30 01:20:48 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-30 01:21:13 +0000 |
commit | d012bfbedf10b925433d1b7bd823370347371e33 (patch) | |
tree | dd7b84c9fcd216b142b6375bf1f1071e6ba59e11 /lib/PublicInbox/View.pm | |
parent | f886760b1b5c79181143743814a576a8fa5cf4d9 (diff) | |
download | public-inbox-d012bfbedf10b925433d1b7bd823370347371e33.tar.gz |
This is a smaller improvement than the landing /$INBOX/ page because full message bodies are shown; but still saves around 100ms for my system with LKML.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index c151f221..8ac405f2 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -1063,25 +1063,10 @@ sub index_nav { # callback for WwwStream sub index_topics { my ($ctx) = @_; my ($off) = (($ctx->{qp}->{o} || '0') =~ /(\d+)/); - my $lim = 200; - my $opts = { offset => $off, limit => $lim }; $ctx->{order} = []; my $srch = $ctx->{srch}; - - my $qs = ''; - # this complicated bit cuts loading time by over 400ms on my system: - if ($off == 0) { - my ($min, $max) = $ctx->{-inbox}->mm->minmax; - my $n = $max - $lim; - $n = $min if $n < $min; - for (; $qs eq '' && $n >= $min; --$n) { - my $smsg = $srch->lookup_article($n) or next; - $qs = POSIX::strftime('d:%Y%m%d..', gmtime($smsg->ts)); - } - } - - my $sres = $srch->query($qs, $opts); + my $sres = $ctx->{-inbox}->recent({offset => $off, limit => 200 }); $sres = $sres->{msgs}; my $nr = scalar @$sres; if ($nr) { |