为什么控制台输出这么慢?

发布于 2024-12-04 15:04:57 字数 123 浏览 3 评论 0原文

因此,我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白首有我共你 2024-12-11 15:04:57

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文