Open MultiTeemer opened 9 years ago
It appears that running this program under spawner consumes too much CPU. Making program to output in blocks like
char buffer[4096];
for (int i = 0; i < 4096; ++i) {
buffer[i] = 'a';
}
buffer[4095] = 0;
while (true) {
std::cout << buffer;
}
appears to be eating less CPU, but nevertheless it is TOO much. Assuming that running program does need time to output data to console and in case of output directly to pipe it doesn't, we may conclude that the reason is in this near-zero cost IO.
As proof of this theory, if you run program with enabled output to std::output you will see dramatic fall in CPU usage down to 0. Of course, I may be wrong.
Anyway, I'll check if there is any way to counter this.
Why cout << "a" in while(true) cycle doesn't cause idle time limit?