On 09/28/2018 09:37 PM, Dave Ulrick wrote:
Note: I don't think this is an issue with buffered I/O to stdout
per se. I say this because I'm seeing pretty consistent run times if I write to stdout
_as long as the output file didn't previously exist_. Rather, the issue seems to be
with _overwriting_ an existing disk file when I/O redirection is used.
Try to add a "sync" before each test to really exclude a buffered I/O
influence.
Your measurements show a 100% CPU in the fast test and lower CPU usage for the slow
cases, so I would still bet on buffering effects (has the previous outfile been
flushed to disk?).
You have not even specified which filesystem you are using and which storage hardware
(HD or SSD?).
Regards.
--
Roberto Ragusa mail at robertoragusa.it