http://bugs.winehq.org/show_bug.cgi?id=12689
Summary: Input messages lingering in server slowing down wine Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: alexd4@inbox.lv
Created an attachment (id=12347) --> (http://bugs.winehq.org/attachment.cgi?id=12347) testcase for problem
Attached testcase illustrates the problem. The problem was originally found in a fan-developed Forsaken mod. I couldn't get feedback on this on wine-devel, so I'm opening a bug for this. Close if it's not a bug or is non-fixable.
How to reproduce: hold a key and move mouse over the window, preferably also clicking mouse buttons, main loop latency steadily increases from 10 to 50 (and even 100) in a short time. In a game this means going from 100 fps to 20 or 10 just because of input messages. Has to be noted that in the actual game the rate of slowdown seemed at least 2-3 times faster when just holding one key and moving mouse, for reasons I don't know, but the testcase still should enough to show the problem.
What the testcase is doing is bad practice, it's basically refusing to process certain types of messages, and PeekMessage just once during a loop is probably bad as well, but that's what the game was originally doing in its main game loop. There are several concerns about it:
1) No slowdown happens on Windows, either in game or in this testcase. No matter how much I move the mouse holding key and clicking madly, it shows same stable 15-16 ticks latency in the testcase. I don't know what it does, but somehow it handles this situation better than Wine.
2) Can this (broken) way of doing things be exposing some inefficiency in message handling, maybe something that could use optimization? I tried to put debug hacks into queue_hardware_message(), it seems that when slowdown is already VERY bad in Forsaken (10fps), message queue in wine server has about 400 or maybe 600 messages. Is that kind of processing overhead per message inevitable? (This is happening on AMD Athlon(tm) 3200+). Perhaps somebody who knows that part of code well may be interested in looking into performance issues in this case. Because, if 400-600 messages in the queue slow down the application to a crawl, then who knows, perhaps it decreases performance of more well-behaved but input-intensive apps as well, just less drastically (holding one or several keys to move, all the while aiming with mouse and abusing mouse buttons is a common thing in games, so there can be quite a few input messages flooding the server).
http://bugs.winehq.org/show_bug.cgi?id=12689
Alexander Dorofeyev alexd4@inbox.lv changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |wineserver Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=12689
--- Comment #1 from Austin English austinenglish@gmail.com 2008-04-20 17:04:57 --- Can you port this testcase to the wine test suite?
http://bugs.winehq.org/show_bug.cgi?id=12689
--- Comment #2 from Alexander Dorofeyev alexd4@inbox.lv 2008-04-21 10:58:41 --- (In reply to comment #1)
Can you port this testcase to the wine test suite?
I don't know how I would do that. It's a performance issue, not a wrong value returned or something. Also I would like somebody who knows these parts of Wine to look into it, because I prefer to hack other things and I'm not even sure this should be considered a bug. Just noticed a difference with native. Maybe it's some kind of problem that could be fixed, maybe just a result from Wine having to do these things more indirectly (via Xserver). Somebody who understand the input message mechanics in Wine well may be able to tell.
http://bugs.winehq.org/show_bug.cgi?id=12689
--- Comment #3 from Austin English austinenglish@gmail.com 2008-10-23 15:40:26 --- Is this still an issue in current (1.1.6 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=12689
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #4 from Austin English austinenglish@gmail.com 2009-01-19 15:15:34 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=12689
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |ABANDONED
--- Comment #5 from Austin English austinenglish@gmail.com 2009-07-21 14:49:39 --- Abandoned. If you still have a problem in current (1.1.26 or newer) wine, and can provide the needed information, feel free to reopen.
http://bugs.winehq.org/show_bug.cgi?id=12689
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Austin English austinenglish@gmail.com 2009-07-21 15:10:49 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=12689
Alexander Dorofeyev alexd4@inbox.lv changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|ABANDONED |
--- Comment #7 from Alexander Dorofeyev alexd4@inbox.lv 2009-08-30 05:51:14 --- There's a testcase demonstrating the problem, I would hope I don't need to babysit this bug forever. And, yes, I think in current git this problem still exists, I launched this test app and was very quickly able to increase loop latency from 10 to 50 by bombarding it with messages (holding key, moving mouse and clicking), CPU athlon 5000+.
http://bugs.winehq.org/show_bug.cgi?id=12689
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=12689
--- Comment #8 from Bruno Jesus 00cpxxx@gmail.com 2011-09-04 19:52:31 CDT --- Created an attachment (id=36233) --> (http://bugs.winehq.org/attachment.cgi?id=36233) Compiled test
I have compiled the example and tested in 1.3.27. I can't reproduce the bug, no matter what I do (pressing keys, moving mouse, moving the window) the tick count is most of the time 10 and while moving the window it sometimes rises to 15.
Can anyone else retest?
http://bugs.winehq.org/show_bug.cgi?id=12689
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #9 from Austin English austinenglish@gmail.com 2011-09-06 05:17:48 CDT --- Reported fixed.
http://bugs.winehq.org/show_bug.cgi?id=12689
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2011-09-09 12:54:28 CDT --- Closing bugs fixed in 1.3.28.