diff options
author | Eric Wong <e@yhbt.net> | 2020-07-05 23:27:49 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-07-06 20:01:15 +0000 |
commit | 7845a9dd163b67e8a03533aee17a74265dc9e14f (patch) | |
tree | df887885ec7e63478acc3f26df6ebbd0400f6978 /lib/PublicInbox | |
parent | bf0f7addf5450f669267536ea2232e8dcf1d4249 (diff) | |
download | public-inbox-7845a9dd163b67e8a03533aee17a74265dc9e14f.tar.gz |
ssearchview: /$INBOX/?q=$QUERY&x=t uses async blobs
Another 10% or so speedup when displaying full messages off search results.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/SearchView.pm | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index eeebdfa3..921992a5 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -287,21 +287,18 @@ sub mset_thread { @$msgs = reverse @$msgs if $r; $ctx->{msgs} = $msgs; - PublicInbox::WwwStream::response($ctx, 200, \&mset_thread_i); + PublicInbox::WwwStream::aresponse($ctx, 200, \&mset_thread_i); } # callback for PublicInbox::WwwStream::getline sub mset_thread_i { - my ($ctx) = @_; - return $ctx->html_top if exists $ctx->{-html_tip}; - my $msgs = $ctx->{msgs} or return; - while (my $smsg = pop @$msgs) { - my $eml = $ctx->{-inbox}->smsg_eml($smsg) or next; - return PublicInbox::View::eml_entry($ctx, $smsg, $eml, - scalar @$msgs); - } - my ($skel) = delete @$ctx{qw(skel msgs)}; - $$skel .= "\n</pre>"; + my ($ctx, $eml) = @_; + $ctx->zmore($ctx->html_top) if exists $ctx->{-html_tip}; + $eml and return PublicInbox::View::eml_entry($ctx, $ctx->{smsg}, $eml, + scalar @{$ctx->{msgs}}); + my $smsg = shift @{$ctx->{msgs}} or + $ctx->zmore(${delete($ctx->{skel})}); + $smsg; } sub ctx_prepare { |