From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Processing speed in large C++ raw strings. Date: Sat, 27 Apr 2019 17:29:49 +0000 Message-ID: <20190427172949.GC4822@ACM> References: <20190425183615.GB19807@ACM> <20190427113734.GA4822@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="229604"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Stefan Monnier , emacs-devel To: Tadeus Prastowo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 27 19:30:45 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKR9x-000xbg-19 for ged-emacs-devel@m.gmane.org; Sat, 27 Apr 2019 19:30:45 +0200 Original-Received: from localhost ([127.0.0.1]:34591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKR9v-0001XL-US for ged-emacs-devel@m.gmane.org; Sat, 27 Apr 2019 13:30:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKR99-0001X5-9t for emacs-devel@gnu.org; Sat, 27 Apr 2019 13:29:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKR98-0005Rg-9A for emacs-devel@gnu.org; Sat, 27 Apr 2019 13:29:55 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:37594 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hKR97-0005QL-V4 for emacs-devel@gnu.org; Sat, 27 Apr 2019 13:29:54 -0400 Original-Received: (qmail 91699 invoked by uid 3782); 27 Apr 2019 17:29:51 -0000 Original-Received: from acm.muc.de (p4FE15039.dip0.t-ipconnect.de [79.225.80.57]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 27 Apr 2019 19:29:50 +0200 Original-Received: (qmail 10109 invoked by uid 1000); 27 Apr 2019 17:29:49 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235991 Archived-At: Hello again, Tadeus. On Sat, Apr 27, 2019 at 17:35:16 +0200, Tadeus Prastowo wrote: > Hi Alan, > On Sat, Apr 27, 2019 at 1:37 PM Alan Mackenzie wrote: > > Thanks for drawing my attention to this problem with lots of templates. > My pleasure. And, thank you very much for looking into this. > > The bug is that, in a certain low-level place, CC Mode was failing to > > mark the < and > "as parentheses" (with syntax-table text properties), > > hence a lot of unneeded buffer scanning was being done. > > The following patch should speed up the scrolling operation markedly. > > It does not become instantaneous, but takes a fraction of a second, > > compared with the several seconds it has taken up to now. Would you > > please try it out. > I apply the following patch to master at commit > 8dc00b2f1e6523c634df3e24379afbe712a32b27, and I confirm that the > following patch works to solve not only the buffer scrolling > sluggishness but also the template parameter editing sluggishness, > including the one that I sent to Stefan earlier today. Thank you very > much, Alan, I really appreciate it. Three lines of a diff to solve my > two-year old sluggishness problem. Thanks indeed! Thanks also for such a rapid reply. I've just committed the patch to all the usual places (including the Emacs master branch). So I think the bug is now fixed. > > diff -r 1940f96b9799 cc-engine.el > > --- a/cc-engine.el Fri Apr 26 01:01:07 2019 +0000 > > +++ b/cc-engine.el Sat Apr 27 11:30:06 2019 +0000 > > @@ -5539,7 +5539,9 @@ > > (prog1 (looking-at "\\s(") > > (forward-char)))) > > (backward-char) > > - (if (c-forward-<>-arglist nil) ; Should always work. > > + (if (let ((c-parse-and-markup-<>-arglists t) > > + (c-restricted-<>-arglists t)) > > + (c-forward-<>-arglist nil)) ; Should always work. > > (when (> (point) to) > > (setq bound-<> (point))) > > (forward-char))) > -- > Best regards, > Tadeus -- Alan Mackenzie (Nuremberg, Germany).