[Wine] Re: Question on Wine CPU usage

cnbiz850 wineforum-user at winehq.org
Thu Sep 1 22:36:27 CDT 2011


Thank you, doh123 for the reply.

I guess the reason that there are 2 wineservers is that I had the 2 applications installed under 2 different WINEPREFIX'es and run them with "WINEPREFIX=..." before the wine command.  (does wineserver only appear once if both are within the same WINEPREFIX?)

Let me further clarify how I ran the apps and did "top".  In the Wine case, I ran TradeBlazer on Desktop 2 and mytrader2009 on Desktop 3, then I did "top" on Desktop 1.  Then I quit out both wine'd apps.  Starting anew on Desktop 4, I started the XP on VirtualBox and then started the 2 apps in XP.  Then again I did "top" on Desktop 1.  That generated the results I posted above.

Now I just tried your suggestion about running top on the same desktop as the apps.  Let's see the results:

In the Wine case, I ran the 2 apps on Desktops 2 & 3 (running them both on the same desktop is not quite convenient as the TradeBlazer window always tries to pop to the top) and I did "top" on Desktop 3 (where mytrader2009 is).  The numbers: 
Code:
  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
29728 cnbiz850      20   0 2666m 112m  15m S   35  2.9   1:23.48 mytrader2009.ex           
 1415 root      	20   0  293m  68m  43m S   22  1.7 100:20.98 Xorg                      
29780 cnbiz850      20   0 2623m  44m  11m S   14  1.1   0:47.21 TradeBlazer.exe           
29783 cnbiz850      20   0  6028 3260  696 S    8  0.1   0:21.56 wineserver                                 
29731 cnbiz850      20   0  7080 4352  688 S    5  0.1   0:30.80 wineserver                
29800 cnbiz850      20   0 2610m  29m 7680 S    4  0.8   0:11.15 tbdatacenter.ex           




In the XP case then I ran VirtualBox on Desktop 4, kept mytrader2009 window on top, then did "top" on the same desktop.  The numbers: 
Code:

  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
30421 cnbiz850      20   0 1271m 653m 599m S   48 16.6   3:03.97 VirtualBox                
 1415 root      	20   0  299m  72m  47m S   24  1.8 101:33.25 Xorg                      




The total for Wine is 66% and the XP case is 48%.  I didn't count the xorg numbers here.  I only want to make a point with the xorg numbers below.

Now let's do some further measures.  

Further case on XP.  Now I keep the VBox intact on Desktop 4, but move the terminal window where I run "top" to Desktop 1.  Now the numbers are as follows: 
Code:
  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
30421 cnbiz850      20   0 1271m 653m 599m S   37 16.6   3:32.82 VirtualBox                                
 1415 root      	20   0  301m  73m  48m S    3  1.9 101:42.26 Xorg                      




Then, I went into XP on Desktop 4 and minimised the 2 app windows (I think this is the case I reported for the XP test on my first post), came back to Desktop 1 and the "top" gives the following numbers: 
Code:
  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
30421 cnbiz850      20   0 1271m 653m 599m S   26 16.6   3:53.26 VirtualBox                              
 1415 root      	20   0  301m  73m  48m S    2  1.9 101:45.24 Xorg                      




Notice, by switching desktops, the number dropped from 48% to 37%.  If the app windows were minimised in XP, then the number dropped further to 26%.  Also notice the big drop of the xorg numbers from 24% to 2%.

Now if do the same things for the Wine case, the numbers are below.

Simply switch desktop: 
Code:
  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
30654 cnbiz850      20   0 2667m 112m  15m R   16  2.9   1:11.06 mytrader2009.ex           
30958 cnbiz850      20   0 2632m  58m  11m S   15  1.5   0:14.82 TradeBlazer.exe           
31081 cnbiz850      20   0  6816 3860  704 R   11  0.1   0:06.70 wineserver                                   
30657 cnbiz850      20   0  7084 4368  692 S    7  0.1   0:46.65 wineserver                
 1415 root      	20   0  297m  69m  44m S    6  1.8 104:59.66 Xorg                      
31142 cnbiz850      20   0 2604m  28m  11m S    3  0.7   0:01.68 tbdatacenter.ex           




Minimise both app windows and then switch desktop:

Code:
  PID USER      	PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                   
30654 cnbiz850      20   0 2667m 112m  15m S   17  2.9   1:25.34 mytrader2009.ex           
30958 cnbiz850      20   0 2632m  58m  11m R   14  1.5   0:26.30 TradeBlazer.exe           
31081 cnbiz850      20   0  7600 4780  708 S   10  0.1   0:15.17 wineserver                               
 1415 root      	20   0  297m  69m  44m S    6  1.8 105:07.25 Xorg                      
30657 cnbiz850      20   0  7084 4368  692 S    6  0.1   0:52.17 wineserver                
31142 cnbiz850      20   0 2604m  28m  11m S    2  0.7   0:03.32 tbdatacenter.ex           



The totals of the 2 sets of numbers not including those of xorg are: 52% and 49%.  Switching desktops make some differences, but minimising windows makes no further difference.  Switching desktops does make xorg number to drop from 22% to 6%.  

In any case, the inclusion of the xorg numbers is important to reflect the end user's needs.  After all, it is at his desire to see the resource usage drop when he puts the apps run at the background (by switching desktop and/or minimising the windows), so that he can use the resource to do something else.

So, if we count the xorg numbers, the total CPU usage changes from active running to inactive running are as follows.  In the XP case, it is 72% (48%+24%) when active and 28% (26%+2%) when inactive.  In the Wine case, it is 88% (66%+22%) when active and 55% (49%+6%)when inactive.

Can we conclude from these that Wine consumes substantially more CPU resources then running XP on VirtualBox?  What can we get from these tests?  Should that be at least the thinking of what are the causes of the inefficiencies in the Wine case?   Maybe it is not Wine alone - could it also include things like Gnome, the window manager (I use Openbox on Gnome), Ubuntu, or Linux kernel.  I don't know, but I do hope the efficiency can be improved.

As to memory usage, I think the number reported above for VirtualBox is not the actual usage by XP but rather the amount allocated by the user to the virtual machine.  In my case, it is 512MB fixed - I don't know if there is a way for VirtualBox to use adjustable memory resource.  Also I view memory usage differently from CPU usage.  Memory is like disk space, and as long as I have enough, using more does not slow the computer down, and also it does not cause that much heat.







More information about the wine-users mailing list