Verbose..

So I was watching stuff being compiled and installed today when it struck me. Does being so verbose reduce the performance?

The reason I ask is because I have written some Monte Carlo simulations before, and as I wrote the code I added a lot of human feedback text for testing purposes. But when I had finished writing the code I removed almost all the text and I noticed that it became faster, as in millions of simulations now took a lot less time to finish.

So I'm curious to know if all the "information" printed on the screen is reducing performance.
 
This is highly dependent on how the verbosity is being handled. The two most outstanding bottlenecks are usually printf(3) and write(2) where the former copies and formats some input data and the later triggers this data to be copied from the userspace to the kernel-side of the output-generating process, as well as read(2) and again write(2) by the process's shell which reads the output generated by the child process and forwards it either to some file descriptor or the X-server/graphics driver.
The later part of this procedure can be avoided by having the process output redirected into /dev/null or something that works alike by the user running the process, but the former can be avoided only if the process supports it, i.e. supports a mode to not even generate diagnosis output.

FreeBSD is very fast at copying data from one process space into another, so redirecting things into the void might render the output to be taken care of very fast, however only if the generation process was quick (e.g. a compiler has collected line information to begin with instead of reanalyzing the input file to do some diagnosis output, did not issue "complex" calls like are done by C++'s STL, and so on).

If it's compiling ports, the process of syntax analysis and especially optimization will take so much time, that the time required to do some output to the screen becomes irrelevant, unless you have a very fast compiler system and a very slow terminal.
 
If you're in X using a software renderer and antialiased fonts, scrolling in a terminal can slow things down. Another reason to use sysutils/tmux and disconnect the session.
 
Too bad they didn't include xfce's Terminal. It's probably not very fast, but I like those antialiased fonts.
 
Back
Top