https://bugs.winehq.org/show_bug.cgi?id=57388
Bug ID: 57388 Summary: Major perf loss with blocking ReadFile() & OVERLAPPED Product: Wine Version: 9.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: nyandarknessgirl@gmail.com Distribution: ---
When using usual blocking file IO & File pointer - based reads (Passing NULL to ReadFile(lpOverlapped)), the performance is relatively similar to native `read()` syscall on the host. However, when passing an OVERLAPPED structure to ReadFile() on a file opened in blocking mode (For pread-like behavior), the performance drops significantly compared to a native pread() syscall on the host. It would be a good thing to fix this, as positioned IO is pretty useful for a lot of apps. Some performance measures:
Native Linux pread() test 512b reads: 1239998.666753 IOPS, 605.468099 MiB/s 4k reads: 1246816.786350 IOPS, 4870.378072 MiB/s 1M reads: 20914.414868 IOPS, 20914.414868 MiB/s
Wine 9.20 on the same host, blocking ReadFile() with OVERLAPPED file position 512b reads: 76785.134791 IOPS, 37.492742 MiB/s 4k reads: 74402.319471 IOPS, 290.634060 MiB/s 1M reads: 14141.221307 IOPS, 14141.221307 MiB/s
In both cases file fully resides in pagecache and no actual random IO is performed, the mere fact that we specify a file position from OVERLAPPED structure affects performance a lot