Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!m2c!ulowell!masscomp!black From: black@masscomp.UUCP (Sam Black) Newsgroups: comp.windows.x Subject: Re: Graphics Context in X11 Keywords: caching, cost Message-ID: <2819@masscomp.UUCP> Date: 25 Jan 88 15:15:33 GMT References: <5163X@utah-cs.UUCP> Reply-To: black@masscomp.UUCP (Sam Black) Organization: MASSCOMP - Westford, Ma Lines: 34 > The X11 Xlib document warns against using too many graphics contexts and > switching between them, as opposed to re-setting the attributes of a few. > I would like to know: > > 1. Does anybody actually cache GC data in the hardware, and if so, what sorts > of data and how much is typically cached? > > 2. What is the range in performance variation between using, say, 30 GCs whose > attributes are never changed, vs one GC with an average of two attribute > settings per graphics call? I'm especially interested in differences between > one server and another. Our server implementation works just the opposite way: it is MUCH faster to switch between GCs than to change values in GCs, assuming you do not switch windows (and thus recalculate clipping). There are several reasons: 1) ValidateGC is avoided 2) ChangeGC is avoided 3) we cache GCs in the hardware (up to several hundred) We haven't come up with actual timing differences, but it can be noticeable. - sam black -------------------------------------- The only difference between men and boys is the price of their toys. And the one who dies with the most toys wins. ...!{cca,decvax,harvard}!masscomp!black UUCP black%masscomp.uucp@ Internet --------------------------------------