From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B72C91F545 for ; Mon, 3 Jul 2023 01:11:34 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=80x24.org header.i=@80x24.org header.a=rsa-sha256 header.s=selector1 header.b=T7qWIFlC; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qG867-0003rc-PM; Sun, 02 Jul 2023 21:11:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qG865-0003r9-NV for dtas-all@nongnu.org; Sun, 02 Jul 2023 21:11:21 -0400 Received: from dcvr.yhbt.net ([173.255.242.215]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qG863-0002Tp-VW for dtas-all@nongnu.org; Sun, 02 Jul 2023 21:11:21 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 49FA91F545 for ; Mon, 3 Jul 2023 01:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1688346678; bh=irGQAKMzmaCT+nGerCQYpI+4E+62CwwvfeB0C9DO5Ro=; h=From:To:Subject:Date:From; b=T7qWIFlCV4f8jtJjj6RgInlu5niacKO+/7lwEHByaONKT3iwPiJsUAfKaN1NsA671 0v7Bdc/4SbXP95SPaR2gO8dQ9V7h+BSQY7B57wJYyvEAsl2imHtSjf3oJXaAsCMBHZ D/4E+41GQx8q/gKwB9rnqi/Tpvuj/oPaDb1wbzBM= From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH] dtas-tl: speed up prune by pipelining requests Date: Mon, 3 Jul 2023 01:11:18 +0000 Message-ID: <20230703011118.955018-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=173.255.242.215; envelope-from=e@80x24.org; helo=dcvr.yhbt.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: dtas-all-bounces+e=80x24.org@nongnu.org We are safely be able to pipeline 10 requests via SOCK_SEQPACKET on any OS without hitting buffering limits. --- bin/dtas-tl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/dtas-tl b/bin/dtas-tl index 45a18b5..66e0612 100755 --- a/bin/dtas-tl +++ b/bin/dtas-tl @@ -138,6 +138,8 @@ def add_after(c, argv, last_id) when 'cat' each_track(c) { |line| print "#{line}\n" } when 'prune' + c2 = nil + pending = 0 each_track(c) do |line| line.sub!(/\A(\d+)=/n, '') or abort "unexpected line=#{line.inspect}\n" track_id = $1.to_i @@ -149,7 +151,19 @@ def add_after(c, argv, last_id) warn "# #{line}: #{e.class}" # raise other exceptions end - c.req("tl remove #{track_id}") unless ok + unless ok + c2 ||= DTAS::UNIXClient.new + if pending > 5 + c2.res_wait + pending -= 1 + end + pending += 1 + c2.req_start("tl remove #{track_id}") + end + end + while pending > 0 + c2.res_wait + pending -= 1 end when 'aac' # add-after-current ARGV.shift