Simon Haegler wrote: >> W.r.t console printing, we've found that on windows, using std::cout/cerr is >> 20 >> times slower than printf. std::ofstream is on par with fprintf/printf >> however. > > on a side note (perhaps you already know this): if you use endl to end a > line, the cout stream is flushed every time. this might cause the > slowdown. using \n for linebreaks ist much faster. there's also the > explicit cout.flush() method.
I know. We do flush (to better catch errors) but even with flushing, std::cout is unacceptably slow, and fflush()/ofstream.flush() is fast. Truly wierd, methinks, since std::cout ought to have fprintf(stdout,...) below everything, just as std::ofstream. Cheers, /Marcus ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
