DEV Community

Cover image for A Little Story About the 'no' Command

A Little Story About the 'no' Command

Takuya Aoki on November 22, 2017

Inspired by this article, I made similar commands as Elixir exercises. http://postd.cc/a-little-story-about-the-yes-unix-command/ This i...
Collapse
 
mattn profile image
Yasuhiro Matsumoto

Sorry if you know why this slow, calling IO.puts every times make performance wrong. system call block until finish of I/O. I'm not good at Elixir, but you've better to use buffer for writing. Actually, yes command does not call write(2) for each lines.

Collapse
 
tokoyax profile image
Takuya Aoki

I didn't know that IO.puts takes such a cost. I'll try to use buffer with Elixir. Thanks for your advice!!

Collapse
 
joshcheek profile image
Josh Cheek

Regarding performance, this was a pretty enlightening post: reddit.com/r/unix/comments/6gxduc/...

Collapse
 
tokoyax profile image
Takuya Aoki

Thanks! The 10GiB/s speed is awesome.