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-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 3BE021F5AD for ; Thu, 9 Apr 2020 20:14:50 +0000 (UTC) Received: from localhost ([::1]:54940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMdZZ-0006cN-CW for e@80x24.org; Thu, 09 Apr 2020 16:14:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35371) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMdXK-0006BP-Ab for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMdXJ-0008Jy-Hv for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:30 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:56358) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jMdXJ-0008Jk-Cr for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:29 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 65CF51F60F for ; Thu, 9 Apr 2020 20:12:22 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH 1/2] splitfx: reduce syscalls for writing comments file Date: Thu, 9 Apr 2020 20:12:21 +0000 Message-Id: <20200409201222.24112-2-e@yhbt.net> In-Reply-To: <20200409201222.24112-1-e@yhbt.net> References: <20200409201222.24112-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.71.152.64 X-Mailman-Approved-At: Thu, 09 Apr 2020 16:14:47 -0400 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 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" We can flush when all comments are buffered to avoid a writev(2) syscall on every comment. --- lib/dtas/splitfx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 8ad919e..384df0f 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -207,11 +207,11 @@ def splitfx_spawn(target, t, opts) env["DITHERFX"] =3D "dither -s" end comments =3D Tempfile.new(%W(dtas-splitfx-#{t.comments["TRACKNUMBER"= ]} .txt)) - comments.sync =3D true t.comments.each do |k,v| env[k] =3D v.to_s comments.puts("#{k}=3D#{v}") end + comments.flush env["COMMENTS"] =3D "--comment-file=3D#{comments.path}" infile_env(env, @infile) outarg =3D outfmt.to_sox_arg