Why is console output so slow?

人盡茶涼 提交于 2019-12-05 21:58:31

问题


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:


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.



来源:https://stackoverflow.com/questions/7404551/why-is-console-output-so-slow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!