为什么控制台输出这么慢?
因此,我在 Windows XP、Vista 和 7 上使用几种不同语言时注意到了这一点。如果每秒将几千行转储到控制台窗口,通常会对系统性能产生负面影响。计算机速度很快,而且总是更快,而控制台看起来就像背景上的一些文本。瓶颈在哪里?
So I have noticed this while using a few differnt languages on Windows XP, Vista and 7. If you dump a couple thousand lines a second to the console window it generally has a negative impact on the performance of the system. Computer are fast, and always faster, and the console looks like just some text on a back ground. Where is the bottle neck?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
printf 等必须通过某种 IPC 到控制台窗口进程(csrss 或 conhost) 控制台也可以与多个进程共享,因此还有一些同步和缓冲正在进行中。
printf etc has to go from your process with some sort of IPC to the Console window process (csrss or conhost) The console can also be shared with several processes so there is also some synchronization and buffering going on.