Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!xzaphod!michael From: michael@xzaphod.uucp (Michael R. Miller) Newsgroups: comp.windows.x Subject: Re: X server speed Keywords: speed Message-ID: <1991Jun01.202725.6560@xzaphod.uucp> Date: 1 Jun 91 20:27:25 GMT References: <1991May30.210439.10218@casbah.acns.nwu.edu> Reply-To: michael@xzaphod.UUCP (Michael R. Miller) Organization: XZaphod in Rockville, MD Lines: 44 In article <1991May30.210439.10218@casbah.acns.nwu.edu> edy@andersen.com (Edy Liongosari) writes: >I am wondering whether any body out there has done any performance testing >of X in Sun Sparc workstations. > >I've tried to draw circles; each circles has radius = 100 pixels and >line width = 1. It takes about 80 sec to draw 3,600 circles using Sun Sparc 1+ >with Graphics Accelerator board (or 45 circles/sec). > >Is there any trick to increase the performance? > >Thanks in advance >-Edy Try drawing the circle once into a bitmap or pixmap and then XCopyArea the offscreen circle to your onscreen location. If the color is the same, a pixmap might be better. If the circles overlap, you can use a bitmap and do some kind of stippling operation (perhaps GXcopy or GXor?) of the bits onto the screen. If you use stippling or tiling, try setting up between 8 and 32 different pixmaps each with it's own GC all set up and ready to use. Then decide which GC to use based upon how your x coordinate modulo {8 or 32} would select a GC (build an N entry table of GCs each with its tile/stipple offset 1 pixel greater than the previous). Your area stippled/tiled is equal to the size of the bitmap/pixmap. Stippling will allow you to use different colors (make sure you set the current foreground in the GC before you draw). Stippling will be slower than tiling because your GC must be re-validated every time you change the FG value. A good server will detect that the stipple rotation didn't change and won't go thru the effort of redoing the origin of the stipple bitmap. But that's a good server. Tiling is the best but most restrictive. Tiling can get you bitblt speeds which should be significantly faster than 45 circles/second. A plain old XCopyArea will be somewhat slower as the server will have to line up the source and destination but you should still do quite well with that. Stippling will probably fall in between the two in speed and much of that performance will be dependent upon the quality of the GC validation routine and the characteristics of your application (ie. how many times you must change the FG value in your GCs). Good luck. Michael R. Miller uunet!xzaphod!michael