X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Fperf-imap-list.t;h=0f00f48799117b682c891095df5dba6e6f61290f;hb=48180dbb004b5f59b2e80613b6fa2e5e869316f1;hp=37640a90f3cb181a455d23cfc1b08d57ae35e84c;hpb=499af0138412496c2a0c84035d5d398fac178624;p=public-inbox.git diff --git a/xt/perf-imap-list.t b/xt/perf-imap-list.t index 37640a90..0f00f487 100644 --- a/xt/perf-imap-list.t +++ b/xt/perf-imap-list.t @@ -9,15 +9,18 @@ use Benchmark qw(:all); my @n = map { { newsgroup => "inbox.comp.foo.bar.$_" } } (0..50000); push @n, map { { newsgroup => "xobni.womp.foo.bar.$_" } } (0..50000); my $self = { imapd => { grouplist => \@n } }; -PublicInbox::IMAPD::refresh_inboxlist($self->{imapd}); - my $n = scalar @n; +my $t = timeit(1, sub { + PublicInbox::IMAPD::refresh_inboxlist($self->{imapd}); +}); +diag timestr($t). "refresh $n inboxes"; + open my $null, '>', '/dev/null' or BAIL_OUT "open: $!"; my $ds = { sock => $null }; my $nr = 200; diag "starting benchmark..."; my $cmd_list = \&PublicInbox::IMAP::cmd_list; -my $t = timeit(1, sub { +$t = timeit(1, sub { for (0..$nr) { my $res = $cmd_list->($self, 'tag', '', '*'); PublicInbox::DS::write($ds, $res);