From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 generating unbelieveable network traffic] Date: Mon, 7 Oct 2002 19:59:08 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <7A03BB6B-DA1E-11D6-8DDC-00039363E640@swipnet.se> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 (Apple Message framework v482) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1034014263 31037 127.0.0.1 (7 Oct 2002 18:11:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2002 18:11:03 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17ycLN-00084B-00 for ; Mon, 07 Oct 2002 20:11:01 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17yd8Y-0004f8-00 for ; Mon, 07 Oct 2002 21:01:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ycEh-0000a8-00; Mon, 07 Oct 2002 14:04:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17ycBI-0007NF-00 for emacs-devel@gnu.org; Mon, 07 Oct 2002 14:00:36 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17ycB1-0007GF-00 for emacs-devel@gnu.org; Mon, 07 Oct 2002 14:00:23 -0400 Original-Received: from stubby.bodenonline.com ([193.201.16.94]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ycAz-0007Bk-00 for emacs-devel@gnu.org; Mon, 07 Oct 2002 14:00:18 -0400 Original-Received: from pc35.bodenonline.com (IDENT:root@pc35.bodenonline.com [195.196.29.227] (may be forged)) by stubby.bodenonline.com (8.12.1/8.12.1) with ESMTP id g97HuEd8028306; Mon, 7 Oct 2002 19:56:15 +0200 Original-To: Ami Fischman In-Reply-To: X-Mailer: Apple Mail (2.482) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8450 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8450 m=E5ndagen den 7 oktober 2002 kl 18.49 skrev Ami Fischman: > "Stefan Monnier" writes: > > [...] > >> As someone whose colormap is full about 95% of the time, I can >> assure you that tose things happen ;-) > > Really? I guess I've been spoiled by my video card (which is a not = very > respectable 4M matrox) and more respectable lack of use of colors :) You can listen for XColormapEvent and invalidate the cache if the = colormap changes. I think Emacs just uses one colormap. > The shame of not caching the XFreeColors has caught up with me, so I = added > a refcount and a wrapper for XFreeColors that takes advantage of the > refcount (so the X server only sees the Free request once per cached = color, > and upon final Free'ing, the cache entry is removed). This ensures = there > are no stale entries in the cache. The performance hit is negligible = in=20 > my > tests. > > The newest versions of xcache.[ch] reflect: > - Reformatted function calls to K&R style > - Added a lot of comments to explain what's going on > - Added refcounting & XFreeColors caching > > Note that in order to take advantage of the XFreeColors caching, you = need > to add the xcache.h header to other files. Included is also a patch = that > does that. Or, for gcc, do make CC=3D'gcc -include xcache.h' Jan D.