Scratch GC performance (was Re: [PATCH] dix: Reshuffle ScreenRec to pack holes)

Adam Jackson ajax at nwnk.net
Thu May 20 11:17:34 PDT 2010


On Wed, 2010-05-19 at 16:04 -0400, Adam Jackson wrote:

> > How awful would it be to kill the GCperDepth pool entirely, and let
> > GetScratchGC always just delegate to CreateScratchGC?
> 
> I suspect that these days it mostly just amortizes malloc overhead for
> scratch GC creation.  We really don't push GC state down to the device
> until the very last second.  I'd want to find a rendering path that
> really hammers scratch GCs to find out though.

So I figured, hey, why not actually measure this.  miPaintWindow() hits
this path, so I did two runs of:

    ./hw/vfb/Xvfb -ac -terminate -screen 0 1366x768x24+32 :1
    DISPLAY=:1 x11perf -map -unmap -destroy -popup -resize

The numbers, sadly, are pretty clear:

1: pooled
2: unpooled (ie, for loop in GetScratchGC behind #if 0)

    1              2           Operation
--------   -----------------   -----------------
717000.0   518000.0 (  0.72)   Map window via parent (4 kids) 
941000.0   713000.0 (  0.76)   Map window via parent (16 kids) 
984000.0   745000.0 (  0.76)   Map window via parent (25 kids) 
918000.0   706000.0 (  0.77)   Map window via parent (50 kids) 
863000.0   676000.0 (  0.78)   Map window via parent (75 kids) 
827000.0   654000.0 (  0.79)   Map window via parent (100 kids) 
677000.0   549000.0 (  0.81)   Map window via parent (200 kids) 
1940000.0   1560000.0 (  0.80)   Unmap window via parent (4 kids) 
3500000.0   3100000.0 (  0.89)   Unmap window via parent (16 kids) 
3910000.0   3300000.0 (  0.84)   Unmap window via parent (25 kids) 
4190000.0   3360000.0 (  0.80)   Unmap window via parent (50 kids) 
4430000.0   4350000.0 (  0.98)   Unmap window via parent (75 kids) 
4830000.0   4380000.0 (  0.91)   Unmap window via parent (100 kids) 
5100000.0   4620000.0 (  0.91)   Unmap window via parent (200 kids) 
960000.0   833000.0 (  0.87)   Destroy window via parent (4 kids) 
1500000.0   1370000.0 (  0.91)   Destroy window via parent (16 kids) 
1590000.0   1480000.0 (  0.93)   Destroy window via parent (25 kids) 
1700000.0   1550000.0 (  0.91)   Destroy window via parent (50 kids) 
1790000.0   1640000.0 (  0.92)   Destroy window via parent (75 kids) 
1830000.0   1670000.0 (  0.91)   Destroy window via parent (100 kids) 
1890000.0   1750000.0 (  0.93)   Destroy window via parent (200 kids) 
378000.0   307000.0 (  0.81)   Hide/expose window via popup (4 kids) 
660000.0   539000.0 (  0.82)   Hide/expose window via popup (16 kids) 
733000.0   586000.0 (  0.80)   Hide/expose window via popup (25 kids) 
720000.0   577000.0 (  0.80)   Hide/expose window via popup (50 kids) 
695000.0   561000.0 (  0.81)   Hide/expose window via popup (75 kids) 
665000.0   528000.0 (  0.79)   Hide/expose window via popup (100 kids) 
556000.0   460000.0 (  0.83)   Hide/expose window via popup (200 kids) 
287000.0   229000.0 (  0.80)   Resize window (4 kids) 
229000.0   193000.0 (  0.84)   Resize window (16 kids) 
213000.0   181000.0 (  0.85)   Resize window (25 kids) 
165000.0   141000.0 (  0.85)   Resize window (50 kids) 
139000.0   122000.0 (  0.88)   Resize window (75 kids) 
123000.0   106000.0 (  0.86)   Resize window (100 kids) 
 79400.0    72000.0 (  0.91)   Resize window (200 kids) 

That's not really a performance hit I'm willing to take.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100520/c76cf89b/attachment.pgp>


More information about the xorg-devel mailing list