https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94268
--- Comment #4 from fdlbxtqi <euloanty at live dot com> --- (In reply to fdlbxtqi from comment #3) > I have found out the reason. It is because the buffer size is too small on > the windows. BUFSIZ == 512 > > You need to set the value to 4096 at least. I think even 65536 is something > should be done since the windows syscall is extremely expensive. I have > tested with WriteFile, the maximum performance needs to set to 131072 > buffer_size with my library. > > I think I can fix this bug easily. The most efficient one is 1048576. However, I think it should be set to at least 65536, although 4096 can already fix most of the problems. Windows syscall is expensive.