From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: C Mode: acceleration in brace deserts. Date: Thu, 3 Dec 2009 17:26:57 +0100 Message-ID: References: <20091203162129.GA1942@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259857659 912 80.91.229.12 (3 Dec 2009 16:27:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Dec 2009 16:27:39 +0000 (UTC) Cc: Chong Yidong , Richard Stallman , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 03 17:27:32 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NGEWf-0004hx-ND for ged-emacs-devel@m.gmane.org; Thu, 03 Dec 2009 17:27:29 +0100 Original-Received: from localhost ([127.0.0.1]:39965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGEWf-0003f5-8y for ged-emacs-devel@m.gmane.org; Thu, 03 Dec 2009 11:27:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGEWb-0003f0-73 for emacs-devel@gnu.org; Thu, 03 Dec 2009 11:27:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGEWV-0003e8-O5 for emacs-devel@gnu.org; Thu, 03 Dec 2009 11:27:23 -0500 Original-Received: from [199.232.76.173] (port=33984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGEWV-0003e4-LA for emacs-devel@gnu.org; Thu, 03 Dec 2009 11:27:19 -0500 Original-Received: from mail-yw0-f172.google.com ([209.85.211.172]:47731) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGEWU-0007tO-8N; Thu, 03 Dec 2009 11:27:18 -0500 Original-Received: by ywh2 with SMTP id 2so1486014ywh.27 for ; Thu, 03 Dec 2009 08:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=03T0ZrK9+XaOhTgpVBfKSD5FuQdYiNo9fH2Js0uybxM=; b=NVg4bMaKeVhaMO05hVe3Z4+N1NLYJ8c44PzfqRm1SaljeaK8byrX7WDLXmgSULzCrH o7q3VdJQr/FTMJWTeX1qeh33FhULCW7R8uLRIJ7zouGDSU+yu7LCeTvc6K+DV1OJAl6f t4yAi3YVMn4Ut3Qdub0X3VpA2icilLnGhU1EY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=NKcO1H6+zgwV7gcMMRi+edHLRzsjYpG/19/7h7nTMZIBouyO78iNZKIRTw+rCu9JFE 4+S96MUnUZcc09Ooj6g61TwYc4Hc4Kf2UTuwViDZx0alLOI3FmJ790EhsRnJJEqfhcr3 KdzVj0hl/YFIC6aeQSLvhytBtYqUaTm3+RNeI= Original-Received: by 10.100.233.35 with SMTP id f35mr2200486anh.41.1259857637147; Thu, 03 Dec 2009 08:27:17 -0800 (PST) In-Reply-To: <20091203162129.GA1942@muc.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118182 Archived-At: Hi Alan, Can you tell me how the cache is implemented so I can support it in MuMaMo? Best wishes, L On Thu, Dec 3, 2009 at 5:21 PM, Alan Mackenzie wrote: > Hi, Richard, Yidong and Emacs! > > I have just committed my enhancements to CC Mode's `c-parse-state'. > This is a central and critical part of Emacs which maintains a cache of > the positions of certain braces, and fewer parens of other types. =C2=A0A= s > the position of interest in a buffer moves, this cache is updated to > reflect the new position. > > In the previous version, the cache handling was severely suboptimal in > "brace deserts", large areas of buffers entirely lacking in braces. =C2= =A0In > the extreme, the algorithm was scanning from BOB every time > c-parse-state was called. > > An example of such an extreme can be downloaded from > . =C2=A0To see the effect, visi= t > it, do M-> and try scrolling back a page at a time. =C2=A0Please compare = the > previous version with the new. > > The difference is noticeable even in our own .../src/lisp.h. =C2=A0It is = now > noticeably less sluggish when scrolling backwards from EOB. > > I have tested these changes thoroughly, principly by calculating > c-parse-state successively at an infinite number (1000) of random points > in the buffers lisp.h and xdisp.c, then comparing "old" results with > "new" results. =C2=A0Many thanks to Stefan for `diff-refine-hunk' :-). > > If anybody notices anything odd, please let me know. > > -- > Alan Mackenzie (Nuremberg, Germany). > > >