From 65339db1168b36cb3ac262eef52f06183dd92ff5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Apr 2020 20:12:21 +0000 Subject: splitfx: reduce syscalls for writing comments file 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 @@ class DTAS::SplitFX # :nodoc: env["DITHERFX"] = "dither -s" end comments = Tempfile.new(%W(dtas-splitfx-#{t.comments["TRACKNUMBER"]} .txt)) - comments.sync = true t.comments.each do |k,v| env[k] = v.to_s comments.puts("#{k}=#{v}") end + comments.flush env["COMMENTS"] = "--comment-file=#{comments.path}" infile_env(env, @infile) outarg = outfmt.to_sox_arg -- cgit v1.2.3-24-ge0c7