about summary refs log tree commit homepage
path: root/xt
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:04:36 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commit509c2cc25c8f21b4e1685de8b475629559c9b2aa (patch)
treee876739c866baa25456af4b76ad44685fee2dd91 /xt
parentdaa98292c95a403975fb4906088c160758b15106 (diff)
downloadpublic-inbox-509c2cc25c8f21b4e1685de8b475629559c9b2aa.tar.gz
It's useful to know how fast SIGHUP can be handled, too.
Diffstat (limited to 'xt')
-rw-r--r--xt/perf-imap-list.t9
1 files changed, 6 insertions, 3 deletions
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);