[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] splitfx: reduce syscalls for writing comments file
From: |
Eric Wong |
Subject: |
[PATCH 1/2] splitfx: reduce syscalls for writing comments file |
Date: |
Thu, 9 Apr 2020 20:12:21 +0000 |
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"] = "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