It's useful to know how fast SIGHUP can be handled, too.
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 } };
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 $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;
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;
for (0..$nr) {
my $res = $cmd_list->($self, 'tag', '', '*');
PublicInbox::DS::write($ds, $res);
for (0..$nr) {
my $res = $cmd_list->($self, 'tag', '', '*');
PublicInbox::DS::write($ds, $res);