Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!EXPO.LCS.MIT.EDU!keith From: keith@EXPO.LCS.MIT.EDU (Keith Packard) Newsgroups: comp.windows.x Subject: Re: XFillRectangle with Tile Vs Manual tiling Message-ID: <9011071643.AA27346@xenon.lcs.mit.edu> Date: 7 Nov 90 16:42:59 GMT References: <723@uni2a.unige.ch> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 37 > In both cases I was using a Pixmap to tile a drawable. I found (much to my > surprise) that the not-so-obvious way was MUCH faster (one my Sparcstation > 1) with an area about twelve times the area of the tile. This seems bizzare > to me, after all the obvious way requires one trip to the server, while the > not-so-obvious way requires many trips. This shouldn't seem so strange to you. Tiling operations are very complicated and cover a wide range of potential usages. The most common tiling operations use small tiles (< 32x32) to fill areas on the screen. The R4 server optimizes this case, and leaves the other cases to wither with pretty horrible code. The problem with other tile sizes is that the server needs to choose to either emulate bitblt code, and plop down repeated blocks of the tile, or to attempt something different. For smaller tiles, emulating bitblt is painfully slow; the frame buffer is repeatedly modified at the same addresses to lay down those bits. Larger tiles could make effective use of the bitblt code without the performance penalty So, while it may seem like the server should always choose the 'fastest' way of doing something, it is also the case that the time spent optimizing various of these algorithms is better spent doing something else. You could spend an arbitrary amount of time optimizing various potential combinations of client requests; this one has never reached the top of the heap. Yes, the R5 server will do the tiling case faster than the bitblt case on color frame buffers. I fixed your example which uses CopyArea to work correctly on CFB (removing the CopyPlane call and disabling GraphicsExpose events) and measured: 24 seconds Tiling code 34 seconds Bitblt code I sped this up several months ago so that xphoon would run reasonably fast on my display. Besides, if everything went as fast as it could, I'd be out of work, wouldn't I.