I have a code where I currently print a lot of diagnostic messages to terminal. Does anybody have any idea how much this slows down my code? Would I get a big speed increase by piping the output to file, e.g. instead of running:
./my_program
i run
./my_program > output.log
Also, would I get a further speed increase by replacing cout with ofstream and writing to file directly?
EDIT: Let's assume I am writing to /dev/shm, disk access speed not really an issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…