http://bugs.winehq.org/show_bug.cgi?id=14373
--- Comment #22 from Matteo bugs.kendatsuba@gmail.com 2010-07-11 17:56:07 --- Created an attachment (id=29547) --> (http://bugs.winehq.org/attachment.cgi?id=29547) cure for slowness
This bug is still present in wine-1.2rc6. Selecting buildings during upgrading, overlords, evolving eggs and everything displaying a progress bar results in 100% CPU usage and slowness. The main cause is an increased number of Locks/Unlocks needed to paint the scene.
As pointed out here:
http://wiki.winehq.org/DirectDraw
frequent Locks/Unlocks can lead to performance losses. Unfortunately even by setting DirectDrawRender to opengl one still gets extremely high CPU usage under the above circumstances.
The attached patch is a hack made specifically for starcraft that tries to overcome the problem. Locks/Unlocks are redirected to a memory buffer and real video memory Locks are allowed to occur roughly 50 times per second. This successfully reduces the CPU overhead both in gdi and opengl mode.
Example: DirectDrawRenderer = opengl with "CPU throttling" enabled in starcarft results in 25-30% CPU usage on my Pentium(R) 4 CPU 2.66GHz even when selecting overlords / buildings.
Note that this is not a fix of wine's directdraw implementation, it will only work with starcraft, possibly breaking other apps. I've tested the patch on wine 1.0.1 (debian testing) and wine 1.2rc6, is there anyone willing to test it further?