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 DBA451FA12 for ; Sat, 2 Jan 2021 09:13:44 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/6] processpipe: lazy-require PublicInbox::DS for dwaitpid Date: Fri, 1 Jan 2021 19:13:40 -1400 Message-Id: <20210102091344.13477-3-e@80x24.org> In-Reply-To: <20210102091344.13477-1-e@80x24.org> References: <20210102091344.13477-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This saves over 20ms with scripts that only use PublicInbox::Spawn. --- lib/PublicInbox/ProcessPipe.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/ProcessPipe.pm b/lib/PublicInbox/ProcessPipe.pm index 400a22f3..e540dc22 100644 --- a/lib/PublicInbox/ProcessPipe.pm +++ b/lib/PublicInbox/ProcessPipe.pm @@ -5,7 +5,6 @@ package PublicInbox::ProcessPipe; use strict; use v5.10.1; -use PublicInbox::DS qw(dwaitpid); use Carp qw(carp); sub TIEHANDLE { @@ -48,7 +47,8 @@ sub _close ($;$) { carp "waitpid($pid, 0) = $wp, \$!=$!, \$?=$?"; } } else { # caller just undef-ed it, let event loop deal with it - dwaitpid $pid, $cb, $arg; + require PublicInbox::DS; + PublicInbox::DS::dwaitpid($pid, $cb, $arg); } $ret; }