diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-03 11:09:06 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-03 12:06:07 +0000 |
commit | 525ba4a6a1289d171a879d9e5d4797183a96ed70 (patch) | |
tree | c83d6db17454411c982878114f2d557738a69529 /t | |
parent | 5a44b89fd9f4ef2688b91262736b0f61095ae99c (diff) | |
download | public-inbox-525ba4a6a1289d171a879d9e5d4797183a96ed70.tar.gz |
We'll be adding more tests in the same vein as this to improve NNTP performance.
Diffstat (limited to 't')
-rw-r--r-- | t/thread-all.t | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/t/thread-all.t b/t/thread-all.t index d4e8c1fc..820fba81 100644 --- a/t/thread-all.t +++ b/t/thread-all.t @@ -6,32 +6,26 @@ use strict; use warnings; use Test::More; use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC); +use PublicInbox::Inbox; my $pi_dir = $ENV{GIANT_PI_DIR}; plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir; -eval { require PublicInbox::Search; }; -plan skip_all => "Xapian missing for $0" if $@; -my $srch = eval { PublicInbox::Search->new($pi_dir) }; -plan skip_all => "$pi_dir not initialized for $0" if $@; +my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir }); +my $srch = $ibx->search; +plan skip_all => "$pi_dir not configured for search $0" unless $srch; require PublicInbox::View; require PublicInbox::SearchThread; -my $pfx = PublicInbox::Search::xpfx('thread'); -my $opts = { limit => 1000000, asc => 1 }; my $t0 = clock_gettime(CLOCK_MONOTONIC); my $elapsed; - -my $sres = $srch->_do_enquire(undef, $opts); -$elapsed = clock_gettime(CLOCK_MONOTONIC) - $t0; -diag "enquire: $elapsed"; - -$t0 = clock_gettime(CLOCK_MONOTONIC); -my $msgs = PublicInbox::View::load_results($srch, $sres); +my $msgs = $srch->{over_ro}->recent({limit => 200000}); +my $n = scalar(@$msgs); +ok($n, 'got some messages'); $elapsed = clock_gettime(CLOCK_MONOTONIC) - $t0; -diag "load_results $elapsed"; +diag "enquire: $elapsed for $n"; $t0 = clock_gettime(CLOCK_MONOTONIC); -PublicInbox::View::thread_results($msgs); +PublicInbox::View::thread_results({-inbox => $ibx}, $msgs); $elapsed = clock_gettime(CLOCK_MONOTONIC) - $t0; diag "thread_results $elapsed"; |