views:

95

answers:

2

What would be the absolute fastest possible way to write a string to the standard/console output on Windows? I'm interested in the solution for both null- and non-null-terminated strings.

+3  A: 

WriteConsole is pretty much the fastest you can get. It's still inter-process call to win32csr (on Windows 7 it's different, but it is still IPC) using LPC, so don't expect performance to be something surprising.

Filip Navara
+1  A: 

2nd on the WriteConsole answer, you can write the entire screen in one call; but also 2nd on what Austin says: having ultrafast console output as a requirement for an application sounds a bit strange to me. Anyway if it's really a bottleneck, maybe use some kind of logging system and provide actual logging to the console a seperate thread?

stijn