https://bugs.winehq.org/show_bug.cgi?id=49852
--- Comment #2 from Jacek Caban jacek@codeweavers.com --- Looking at kernel32 side of it, I can see a lot of one character writes. That's from fputc() msvcrt calls. Maybe it should be buffered on msvcrt side, I didn't look at that.
Current console code implements bare console support in kernel32 itself and it essentially just writes directly to host std output fd. It's fast, but it also has a number of limitations. Originally motivated by migration to PE files, I'm currently working on changing it to be more similar to Windows, where those calls are forwarded to a separated process that manages the console, processes write and forwards to host console, when appropriate. With the additional IPC, some performance drop is unfortunately not avoidable.
For me, your test runs with current time in 15s on Linux with current git.
With some patches that I plan to send soon that will change bare console to use mentioned ioctl, it runs in 42s.
I hacked ioctl handling a bit so that client doesn't wait for conhost to complete (so we can't propagate error from conhost). With the hack it runs in 9s.
Avoiding using tty code path reduces that time to 2.5s (something like wine ihateeh-x86_64.exe |cat)
The application takes about 14s to run on Windows for me, so our performance is not really that bad in comparison.