X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fexa%2Funderstanding_rectangles.mdwn;h=facb3dc36b4144ffe2902f44f54485d47cd095f5;hb=5c014fe14d7a114dc525711d3236feb10f27177f;hp=8c92fc402be27bcfc9ca071c4f5e50720c792a59;hpb=6f23dc531a5dfbde3bbc5d15e412908747d41063;p=cworth.org diff --git a/src/exa/understanding_rectangles.mdwn b/src/exa/understanding_rectangles.mdwn index 8c92fc4..facb3dc 100644 --- a/src/exa/understanding_rectangles.mdwn +++ b/src/exa/understanding_rectangles.mdwn @@ -1,6 +1,6 @@ -[[meta title="Understanding the cairo rectangles performance test case"]] +[[!meta title="Understanding the cairo rectangles performance test case"]] -[[tag cairo exa xorg]] +[[!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