http://bugs.winehq.org/show_bug.cgi?id=30224
Bug #: 30224 Summary: Piping wine in a shell makes it run slower. Product: Wine Version: 1.4 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: qparis@playonlinux.com Classification: Unclassified
Sometimes, it can be useful to run wine through pipes to catch debug logfiles. For exemple, we might want to run something like wine 2>&1 | tee -a logfile.log to get stdout and stderr into a logfile The problem is that if wine is run like this, it takes 4 seconds to exit. The problems does not appear to be important, but sometimes (bash scripts, POL, winetricks for example), we need to run wine several times and we want to log everything. This problem really slows down the process.
The problem is really simple to reproduce : in a clean wineprefix, run the two following commands:
time wine wineconsole 2>&1 | cat # real 0m4.912s
time wine wineconsole 2>&1 | grep Usage # real 0m4.006s
time wine wineconsole 2>&1 # real 0m0.865s
For the first commands (the slow ones), we can see that wineconsole takes time to exit without knowing why.
This problem does not appear if stdin and stdout are separated:
time wine wineconsole | cat # real 0m0.836s
time wine wineconsole > >(cat) 2> >(cat) # real 0m0.774s