X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fexa%2Funderstanding_rectangles.mdwn;h=facb3dc36b4144ffe2902f44f54485d47cd095f5;hb=037e46baab3d852806dd050475250277506b20c2;hp=5973620c6d2a60c78fb7496a8a3f2c123660f253;hpb=c71d0b98f5c3de49e6f522f9640e9b659e946662;p=cworth.org diff --git a/src/exa/understanding_rectangles.mdwn b/src/exa/understanding_rectangles.mdwn index 5973620..facb3dc 100644 --- a/src/exa/understanding_rectangles.mdwn +++ b/src/exa/understanding_rectangles.mdwn @@ -1,6 +1,6 @@ -[[tag cairo exa xorg]] +[[!meta title="Understanding the cairo rectangles performance test case"]] -# Understanding the cairo rectangles performance test case +[[!tag cairo exa xorg]] About a month ago (can it have been that long already?) I started an effort to try to [baseline EXA performance on an r100 @@ -54,13 +54,13 @@ cairo-based rectangles test case looked about like this: } That is, each rectangle was being filled individually. I experimented -with changing this so that many calls were made to cairo_rectangle for -each call to cairo_fill. The mysterious EXA slowdown I had been +with changing this so that many calls were made to `cairo_rectangle` for +each call to `cairo_fill`. The mysterious EXA slowdown I had been chasing went away, but only because everything became a lot slower. It turns out there's a bad performance bug in cairo when it converts from -a list of rectangular trapezoids to a pixman_region. Cairo's pixman +a list of rectangular trapezoids to a `pixman_region`. Cairo's pixman doesn't expose a function for "create region from list of rectangles" -so cairo is calling a pixman_region_union function once for every +so cairo is calling a `pixman_region_union` function once for every rectangle. This looks like an unnecessary O(n**2) algorithm to me. Fortunately that should be a simple thing to fix. @@ -72,7 +72,7 @@ protocol tracing[*] revealed that XFillRectangle is batching requests while XRenderFillRectangles is not. That's a rather nasty trap for an unwary Xlib coder like myself. I added batching in chunks of 256 rectangles around XRenderFillRectangles and it started behaving -precisely like XRenderFillRectangles. +precisely like XFillRectangles. Finally, I eliminated some non-determinism from the rectangles test case. Originally, it was written to choose randomly-sized rectangles