From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7DFA11FBEC for ; Wed, 10 Jun 2020 07:06:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 39/82] xt/perf-imap-list: time refresh_inboxlist Date: Wed, 10 Jun 2020 07:04:36 +0000 Message-Id: <20200610070519.18252-40-e@yhbt.net> In-Reply-To: <20200610070519.18252-1-e@yhbt.net> References: <20200610070519.18252-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's useful to know how fast SIGHUP can be handled, too. --- xt/perf-imap-list.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xt/perf-imap-list.t b/xt/perf-imap-list.t index 37640a90f3c..0f00f487991 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);