Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!grogers From: grogers@m.cs.uiuc.edu Newsgroups: comp.windows.x Subject: Re: Using Multiple Graphics Contexts Message-ID: <26900057@m.cs.uiuc.edu> Date: 20 Dec 88 03:13:00 GMT References: <8404@pasteur.Berkeley.EDU> Lines: 26 Nf-ID: #R:pasteur.Berkeley.EDU:8404:m.cs.uiuc.edu:26900057:000:1088 Nf-From: m.cs.uiuc.edu!grogers Dec 19 21:13:00 1988 Within our XGKS library we found two significant speedups related to GCs. The first was to use more of them. At first we used one GC for all five gks output primitives. This meant that we were changing the color, pattern, etc. values in the GC with just about every gks output function call. We later changed to using one GC per output primitive type. Although we have no benchmark evidence, the speedup was visually apparent for all programs. The second speedup was to peek at the Xlib's cached GC to avoid making Xlib calls to set GC values to what they currently are. This again made a noticeable difference. This is because Xlib does not filter out unnecessary nonchanges to the GC. Based on our experience I would recommend using GCs to avoid GC changes and modifying the Xlib implementation to filter out the nonchanges. Greg Rogers University of Illinois at Urbana-Champaign Department of Computer Science 1304 W. Springfield Ave. Urbana, IL 61801 (217) 333-6174 UUCP: {pur-ee,convex,inhp4}!uiucdcs!grogers ARPA: grogers@a.cs.uiuc.edu CSNET: grogers%uiuc@csnet-relay