about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-09 20:12:21 +0000
committerEric Wong <e@yhbt.net>2020-04-20 10:04:00 +0000
commit65339db1168b36cb3ac262eef52f06183dd92ff5 (patch)
tree75f1fa60a54ec3ed796e14860471c12064d7db77
parente73e6b5e7fb0d7077ba6959ca155677779ae4681 (diff)
downloaddtas-65339db1168b36cb3ac262eef52f06183dd92ff5.tar.gz
We can flush when all comments are buffered to avoid a writev(2)
syscall on every comment.
-rw-r--r--lib/dtas/splitfx.rb2
1 files changed, 1 insertions, 1 deletions
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