[comp.windows.open-look] Xnews vs Xsun on SPARCstation 2 GX

tn@leadsv.UUCP (Tristan Nefzger) (12/05/90)

Several issues should be considered when comparing Openwindows (OW)
2.0 with X11R4.  These include availablity, cost, suppport,
functionality, ease of use, resource requirements and performance.
Even though OW is free (with SunOS 4.1.1) like X11R4, is a "supported"
product, provides possibly critical functionality (X11 and Sunview)
and ease of use, it requires 2-3 times the resources (RAM and swap)
and has a server which performs poorly compared to the X11R4 server in
important ways.  This is a comparison of the performance of the OW
xnews server with the MIT X11R4 Xsun server.

There are several sorts of operations on and in windows and xnews may
be better than Xsun at about half of them on certain hardware
platforms.  During the beta test of the SPARCstation 2 (Calvin) GX and
SunOS 4.1.1, which includes OW 2.0, I had occasion to compare the
performance of the two servers.  Generally, it turns out that on this
platform xnews performs better than Xsun for operations which are
accelerated by the CG6 color graphics frame buffer/accelerator board.
This is mainly because only xnews takes advantage of CG6 acceleration.
These operations are, for the most part, those done in windows versus
those done on windows.

The tool used to compare the servers was x11perf written by Joel
McCormack, Phil Karlton, Susan Angenbranndt and Chris Kent.  X11perf
is capable of some 222 individual tests which include those measuring
performance along traditional graphics dimensions (drawing speed for
lines, polygons, text, etc.) as well as those measuring window
management performance.*  The benchmarking method consisted of running
all of the x11perf tests (using the "-all" option) on a standalone
Calvin GX running strictly off local disk with logins and mounting of
remote filesystems disabled and immediately after rebooting SunOS
4.1.1 and starting the respective server.  As mentioned, the OW xnews
server was from the 2.0 Release.  The X11R4 Xsun server was compiled
at patch level 18 with the SunOS 4.1.1-Beta C compiler at level 2
optimization (-O) with dynamic linking.  X11perf (version 1.2) was 
compiled under identical conditions.

Brief analysis shows that xnews is superior on the Calvin GX in terms
of line drawings (including lines, triangles, rectangles, trapezoids
and complex polygons); character operations; scrolling; 1-bit plane
deep copies; window circulation; and window operations via parent
(except destroy).  All of these except the last are most likely due to
CG6 acceleration, since they are operations which this board was built
to perform well.  On the other hand, Xsun is superior on this platform
in terms of single pixel drawing; ellipses (including circles); copies
involving pixmaps; window creation, movement, resizing,
hiding/exposing via popups, and destruction; basic non-graphics X11
calls like GetAtomName and GetProperty; and changing the graphics
context (helpful for things like virtual desktops).

Comparing the servers in terms of window operations, it appears to
that Xsun without CG6 acceleration outperforms xnews with CG6
acceleration in most cases and that these cases are the most important
ones.  In other words, most people do a lot of window creation,
moving, resizing, hiding, exposing and destroying (After all what is a
window system for?) -- and these are operations which Xsun is
especially good at compared to xnews.  Below is a table summary of how
the servers compare in the various test categories followed by short
comments and finally by the x11perfcomp comparison of the output of
the x11perf runs.

* x11perf manpage.
==============================================================================
Summary Table of Xnews vs Xsun Performance
------------------------------------------

xnews   Xsun   operation                      
-----   ----   ---------------------------  
        +      Dot                                                      
+              rectangle                      
+              line                           
        +      circle                         
        +      ellipse                        
+              triangle                       
+              trapezoid                      
+              complex polygon                
+              char                           
+              scroll                         
+              copy from window to window     
        +      copy from pixmap to window     
        +      copy from window to pixmap     
        +      copy from pixmap to pixmap     
+              copy 1-bit deep plane          
        +      PutImage                        
        +      GetImage                       
+              X protocol NoOperation         
        +      GetAtomName                    
        +      GetProperty                    
        +      Change graphics context        
        +      Create and map subwindows      
        +      Create unmapped window         
+              Map window via parent          
+              Unmap window via parent        
        +      Destroy window via parent      
        +      Hide/expose window via popup   
        +      Move window                    
        +      Moved unmapped window          
+              Move window via parent         
        +      Resize window                  
        +      Resize unmapped window         
+              Circulate window               
+              Circulate Unmapped window      



Comments (per operation category)
---------------------------------

 0.  Dot: Xsun about 50% faster than xnews for single pixel drawing.
 
 1.  Rectangle: xnews generally clobbers Xsun (except for tiled rects).
     The large differences can only be due to CG6 acceleration.

 2.  Line: xnews performs better than Xsun except for dashed and wide
     lines.  Probably Xsun is better here than xnews would be without CG6
     acceleration.

 3.  Circle: It's surprising how much faster Xsun draws plain, dashed
     and partial circles compared to xnews--guess these ops aren't easily
     handled by the CG6.

 4.  Ellipse:  Except for wide and filled ellipses, Xsun outperforms
     xnews.  It's interesting that xnews can draw and fill an ellipse faster
     than just drawing it (almost by a factor of 2 for 100 pixel ellipses).

 5.  Triangle:  Here the CG6 doesn't much matter for triangles having
     sides of length <10 pixels.
     
 6.  Trapezoid: Xnews much better than Xsun except for small (10 pixel
     sides) trapezoids.  Some differences which are greater than an order
     of magnitude can only be due to CG6 acceleration.

 7.  Complex polygon:  Xnews is uniformly superior here compared to Xsun,
     but again the difference grows with side length.

 8.  Char:  Xnews is again uniformly superior compared to Xsun, but here
     the difference is more pronounced for smaller char lines (30 chars)
     compared to larger (80 chars) ones.

 9.  Scroll:  CG6 gives xnews a x10 gain on Xsun but only for scrolling
     areas >= 100x100 pixels.

10.  Window to window copy: Xnews much better than Xsun except for
     small (10x10) windows.

11.  Pixmap to window copy: Same as for window to window copy ops except
     that xnews superiority is not as pronounced for large copies.

12.  Window to pixmap copy:  Xsun is uniformly superior here compared to 
     xnews with the relative difference decreasing with copy area.

13.  Pixmap to pixmap copy:  Xsun is uniformly superior here compared to 
     xnews with the relative difference decreasing with copy area.

14.  1-bit deep plane copy:  Xnews is superior to Xsun except for small
     (10x10) copy areas.

15.  PutImage: Xsun is slightly superior to xnews here.

16.  GetImage: Xsun is greatly superior to xnews here.

17.  NoOperation, GetAtomName, Getproperty and change graphics context:
     Xsun is generally better to xnews here except for NoOperation.

18.  Create and map subwindow: Xsun much better than xnews here.  Xsun
     peaks at 25 kids while xnews performance monotonically increases with 
     the number of kids.

19.  Create unmapped window: Xsun much better than xnews here.  Xsun
     performance is independent of number of kids while xnews shows a slight
     improvement as the number of kids increases.

20.  Map window via parent:  Xnews much better than Xsun here.  Xnews
     performance dramatically increases by >100% as the number of kids goes
     from 4 to 200 while Xsun performance improves by only 50%.

21.  Unmap window via parent: Xnews much better than Xsun except for
     the 4 kids case.  The rate of xnews improvement with the number of kids
     is about 2 times that for Xsun.

22.  Destroy window via parent:  Except for the 4 kids case, Xsun 
     performance is much better than xnews' here.   It's interesting that
     Xsun performance nearly triples for 16 kids compared to 4 kids and then
     levels off.

23.  Hide/expose window via popups:  Xsun much better than xnews and here
     xnews shows decreased performance going from 75-200 kids.

24.  Move window:  Xsun outperforms xnews except for the 200 kids case
     where the difference is <10%.

25.  Move unmapped window:  Xsun performance is uniformly 2x that of xnews.
     Both servers show slight decreases with incresing number of kids.

26.  Move window via parent: Xnews greatly outperforms Xsun here except for
     4 kids.  Xnews shows large impovement with number of kids over the whole
     range from 4-200 while Xsun levels off at about 50 kids.

27.  Resize window:  Xsun better than xnews except for 200 kids where they 
     perform about the same.

28.  Resize unmapped window:  Xsun about 2.5x faster than xnews for all
     numbers of kids.  Performance for both servers show slight decreases
     with increased kids.

29.  Circulate window: Xnews about 10-20% faster in the 4-75 kids region, but
     Xsun takes the lead at 200 kids.

30.  Circulate unmapped window:  Xnews performance constant and superior 
     compared to Xsun especially with increased kids as Xsun performance
     decreases.


X11perf output
----------------------------
(* indicates xnews > Xsun; all units are reps/sec)

1: calvin-xnews
2: calvin-Xsun

     1         2    Operation
--------  --------  ---------
204000.0  291000.0  Dot

*156000.0   98900.0  1x1 rectangle
*123000.0   24700.0  10x10 rectangle
*  8190.0     717.0  100x100 rectangle
*   392.0      31.6  500x500 rectangle
*155000.0   38000.0  1x1 stippled rectangle
*123000.0    6380.0  10x10 stippled rectangle
*  8170.0     335.0  100x100 stippled rectangle
*   390.0      19.3  500x500 stippled rectangle
*155000.0   44900.0  1x1 opaque stippled rectangle
*123000.0    9810.0  10x10 opaque stippled rectangle
*  8160.0     529.0  100x100 opaque stippled rectangle
*   390.0      29.2  500x500 opaque stippled rectangle
* 22500.0   76000.0  1x1 4x4 tiled rectangle
* 15200.0   23500.0  10x10 4x4 tiled rectangle
*   976.0     714.0  100x100 4x4 tiled rectangle
*    43.9      31.6  500x500 4x4 tiled rectangle
  28400.0   48700.0  1x1 161x145 tiled rectangle
* 14300.0   13200.0  10x10 161x145 tiled rectangle
*   578.0     456.0  100x100 161x145 tiled rectangle
*    26.3      21.6  500x500 161x145 tiled rectangle

*155000.0   96600.0  1-pixel line segment
*139000.0   61800.0  10-pixel line segment
* 38000.0   16300.0  100-pixel line segment
*  9010.0    3830.0  500-pixel line segment
* 38200.0   12900.0  100-pixel line segment (1 kid)
* 32200.0   11200.0  100-pixel line segment (2 kids)
* 24500.0    9940.0  100-pixel line segment (3 kids)
  39100.0   44100.0  10-pixel dashed segment
* 12600.0   11300.0  100-pixel dashed segment
* 10900.0   10200.0  100-pixel double-dashed segment
*304000.0  112000.0  1-pixel line
*211000.0   68500.0  10-pixel line
* 41900.0   16700.0  100-pixel line
*  9180.0    3850.0  500-pixel line
  41800.0   49100.0  10-pixel dashed line
* 12900.0   11600.0  100-pixel dashed line
* 11200.0   10400.0  100-pixel double-dashed line
*172000.0    7530.0  10x1 wide line
    574.0    1380.0  100x10 wide line
*   391.0     159.0  500x50 wide line
     91.5     577.0  100x10 wide dashed line
     81.3     560.0  100x10 wide double-dashed line

* 68000.0   40100.0  1-pixel circle
* 55800.0   23700.0  10-pixel circle
   3070.0    5260.0  100-pixel circle
    284.0    1210.0  500-pixel circle
    302.0     799.0  100-pixel dashed circle
    304.0     598.0  100-pixel double-dashed circle
* 55900.0     522.0  10-pixel wide circle
    133.0     133.0  100-pixel wide circle
*    53.2      25.0  500-pixel wide circle
     17.8      38.6  100-pixel wide dashed circle
     12.1      29.0  100-pixel wide double-dashed circle
   1070.0   12800.0  10-pixel partial circle
    742.0    4390.0  100-pixel partial circle
* 68200.0  179000.0  1-pixel solid circle
* 56000.0   16000.0  10-pixel solid circle
*  3090.0     765.0  100-pixel solid circle
*   292.0      39.0  500-pixel solid circle
    797.0    7650.0  10-pixel fill chord partial circle
    582.0     976.0  100-pixel fill chord partial circle
    801.0    6470.0  10-pixel fill slice partial circle
    532.0     944.0  100-pixel fill slice partial circle

   6650.0   23400.0  10-pixel ellipse
   1730.0    5860.0  100-pixel ellipse
    392.0    1360.0  500-pixel ellipse
    400.0     965.0  100-pixel dashed ellipse
    417.0     728.0  100-pixel double-dashed ellipse
*  6550.0     272.0  10-pixel wide ellipse
*   143.0      49.5  100-pixel wide ellipse
*    62.1      10.2  500-pixel wide ellipse
*    24.0      16.8  100-pixel wide dashed ellipse
*    15.9       9.9  100-pixel wide double-dashed ellipse
   1080.0   12200.0  10-pixel partial ellipse
    775.0    5020.0  100-pixel partial ellipse
   8310.0   19000.0  10-pixel filled ellipse
*  2570.0    1350.0  100-pixel filled ellipse
*   498.0      76.0  500-pixel filled ellipse
    808.0    8340.0  10-pixel fill chord partial ellipse
    617.0    1950.0  100-pixel fill chord ellipse
    793.0    7060.0  10-pixel fill slice partial ellipse
    579.0    1810.0  100-pixel fill slice ellipse

*  8350.0   14400.0  Fill 1-pixel/side triangle
*  8360.0    7040.0  Fill 10-pixel/side triangle
*  5520.0     497.0  Fill 100-pixel/side triangle

   8120.0    8280.0  Fill 10x10 trapezoid
*  5710.0     550.0  Fill 100x100 trapezoid
*  6910.0    2590.0  Fill 10x10 stippled trapezoid
*  5180.0      46.5  Fill 100x100 stippled trapezoid
*  6900.0    2880.0  Fill 10x10 opaque stippled trapezoid
*  5160.0      53.8  Fill 100x100 opaque stippled trapezoid
*  5110.0    2540.0  Fill 10x10 tiled trapezoid
*  2420.0      41.7  Fill 100x100 tiled trapezoid

*  5340.0    4170.0  Fill 10-pixel/side complex polygon
*  2130.0     460.0  Fill 100-pixel/side complex polygons

* 84800.0   52300.0  Char in 80-char line (6x13)
*106000.0   72300.0  Char in 80-char line (TR 10)
* 63500.0   23300.0  Char in 30-char line (TR 24)
* 73700.0   54000.0  Char in 20/40/20 line (6x13, TR 10)
* 69600.0   69100.0  Char in 80-char image line (6x13)
* 88600.0   39600.0  Char in 80-char image line (TR 10)
* 45700.0   11200.0  Char in 30-char image line (TR 24)

* 3300.0    8050.0  Scroll 10x10 pixels
* 2770.0     294.0  Scroll 100x100 pixels
*  138.0      12.7  Scroll 500x500 pixels

  3340.0    7490.0  Copy 10x10 from window to window
* 1570.0     270.0  Copy 100x100 from window to window
*   72.0      11.7  Copy 500x500 from window to window

  3890.0    9440.0  Copy 10x10 from pixmap to window
*  674.0     570.0  Copy 100x100 from pixmap to window
*   34.8      25.5  Copy 500x500 from pixmap to window

  2560.0    8390.0  Copy 10x10 from window to pixmap
   277.0     337.0  Copy 100x100 from window to pixmap
    13.7      14.6  Copy 500x500 from window to pixmap

  3860.0   11300.0  Copy 10x10 from pixmap to pixmap
   639.0     904.0  Copy 100x100 from pixmap to pixmap
    35.0      41.7  Copy 500x500 from pixmap to pixmap

  3650.0    8100.0  Copy 10x10 1-bit deep plane
* 1670.0     582.0  Copy 100x100 1-bit deep plane
*  199.0      29.1  Copy 500x500 1-bit deep plane

  4330.0    4820.0  PutImage 10x10 square
   123.0     135.0  PutImage 100x100 square
     5.5       5.9  PutImage 500x500 square

*  306.0     621.0  GetImage 10x10 square
*   39.0     141.0  GetImage 100x100 square
*    1.6       7.1  GetImage 500x500 square

*131000.0  126000.0  X protocol NoOperation

   548.0     794.0  GetAtomName

   532.0     774.0  GetProperty

  9970.0   13900.0  Change graphics context

  1480.0    2410.0  Create and map subwindows (4 kids)
  1740.0    2870.0  Create and map subwindows (16 kids)
  1770.0    2920.0  Create and map subwindows (25 kids)
  1810.0    2840.0  Create and map subwindows (50 kids)
  1820.0    2820.0  Create and map subwindows (75 kids)
  1840.0    2760.0  Create and map subwindows (100 kids)
  1840.0    2570.0  Create and map subwindows (200 kids)

  2260.0    6520.0  Create unmapped window (4 kids)
  2450.0    6580.0  Create unmapped window (16 kids)
  2450.0    6540.0  Create unmapped window (25 kids)
  2480.0    6560.0  Create unmapped window (50 kids)
  2500.0    6630.0  Create unmapped window (75 kids)
  2500.0    6640.0  Create unmapped window (100 kids)
  2500.0    6590.0  Create unmapped window (200 kids)

* 4520.0    3080.0  Map window via parent (4 kids)
* 8120.0    4300.0  Map window via parent (16 kids)
* 8910.0    4510.0  Map window via parent (25 kids)
* 9780.0    4510.0  Map window via parent (50 kids)
*10100.0    4570.0  Map window via parent (75 kids)
*10200.0    4610.0  Map window via parent (100 kids)
*10400.0    4570.0  Map window via parent (200 kids)

 12300.0   13800.0  Unmap window via parent (4 kids)
*36500.0   26700.0  Unmap window via parent (16 kids)
*47300.0   30100.0  Unmap window via parent (25 kids)
*64400.0   30100.0  Unmap window via parent (50 kids)
*72700.0   34300.0  Unmap window via parent (75 kids)
*78900.0   35100.0  Unmap window via parent (100 kids)
*90500.0   36100.0  Unmap window via parent (200 kids)

* 3330.0    3270.0  Destroy window via parent (4 kids)
  5170.0    9340.0  Destroy window via parent (16 kids)
  5520.0   10700.0  Destroy window via parent (25 kids)
  5890.0   11900.0  Destroy window via parent (50 kids)
  6060.0   12300.0  Destroy window via parent (75 kids)
  6010.0   12500.0  Destroy window via parent (100 kids)
  6250.0   12700.0  Destroy window via parent (200 kids)

  1300.0    1400.0  Hide/expose window via popup (4 kids)
  1930.0    2340.0  Hide/expose window via popup (16 kids)
  2130.0    2540.0  Hide/expose window via popup (25 kids)
  2050.0    2660.0  Hide/expose window via popup (50 kids)
  2060.0    2720.0  Hide/expose window via popup (75 kids)
  1900.0    2730.0  Hide/expose window via popup (100 kids)
  1680.0    2740.0  Hide/expose window via popup (200 kids)

   729.0    1300.0  Move window (4 kids)
   660.0     967.0  Move window (16 kids)
   618.0     853.0  Move window (25 kids)
   495.0     669.0  Move window (50 kids)
   459.0     540.0  Move window (75 kids)
   377.0     434.0  Move window (100 kids)
*  261.0     244.0  Move window (200 kids)

 10200.0   21600.0  Moved unmapped window (4 kids)
 10300.0   21300.0  Moved unmapped window (16 kids)
 10300.0   21400.0  Moved unmapped window (25 kids)
  9990.0   21000.0  Moved unmapped window (50 kids)
  9600.0   21000.0  Moved unmapped window (75 kids)
  9650.0   20800.0  Moved unmapped window (100 kids)
  9510.0   20000.0  Moved unmapped window (200 kids)

  2790.0    3730.0  Move window via parent (4 kids)
*10200.0    7160.0  Move window via parent (16 kids)
*15200.0    8110.0  Move window via parent (25 kids)
*27200.0    9220.0  Move window via parent (50 kids)
*36200.0    9630.0  Move window via parent (75 kids)
*43800.0    9800.0  Move window via parent (100 kids)
*56800.0    9860.0  Move window via parent (200 kids)

   786.0    1240.0  Resize window (4 kids)
   731.0     999.0  Resize window (16 kids)
   706.0     900.0  Resize window (25 kids)
   561.0     738.0  Resize window (50 kids)
   506.0     616.0  Resize window (75 kids)
   431.0     518.0  Resize window (100 kids)
*  300.0     284.0  Resize window (200 kids)

  7300.0   18900.0  Resize unmapped window (4 kids)
  7230.0   18700.0  Resize unmapped window (16 kids)
  7350.0   18600.0  Resize unmapped window (25 kids)
  7270.0   18700.0  Resize unmapped window (50 kids)
  7190.0   18300.0  Resize unmapped window (75 kids)
  7100.0   18400.0  Resize unmapped window (100 kids)
  6980.0   17600.0  Resize unmapped window (200 kids)

*  592.0     567.0  Circulate window (4 kids)
*  489.0     382.0  Circulate window (16 kids)
*  457.0     367.0  Circulate window (25 kids)
*  398.0     345.0  Circulate window (50 kids)
*  354.0     331.0  Circulate window (75 kids)
*  318.0     315.0  Circulate window (100 kids)
   223.0     267.0  Circulate window (200 kids)

 61700.0   65300.0  Circulate Unmapped window (4 kids)
*61800.0   49900.0  Circulate Unmapped window (16 kids)
*61800.0   44000.0  Circulate Unmapped window (25 kids)
*61900.0   33300.0  Circulate Unmapped window (50 kids)
*62000.0   24300.0  Circulate Unmapped window (75 kids)
*62100.0   18800.0  Circulate Unmapped window (100 kids)
*60900.0   11000.0  Circulate Unmapped window (200 kids)

--------  --------
4.88e+06  3.18e+06   Grand total rates for all 222 tests

xnews     Xsun

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Tristan Nefzger
Tel.: 408-743-0220
Email: lad-shrike!leadsv!tn

"If I knew what two and two were - I would say Four!"

			-Saying of Mulla Nasrudin-