Why is console output so slow?

2019-04-06 20:49发布

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?

1条回答
手持菜刀,她持情操
2楼-- · 2019-04-06 21:21

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.

查看更多
登录 后发表回答