From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tadeus Prastowo Newsgroups: gmane.emacs.devel Subject: Re: Processing speed in large C++ raw strings. Date: Sat, 27 Apr 2019 17:35:16 +0200 Message-ID: References: <20190425183615.GB19807@ACM> <20190427113734.GA4822@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="3029"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 27 17:36:12 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 1hKPN5-0000cp-Sx for ged-emacs-devel@m.gmane.org; Sat, 27 Apr 2019 17:36:12 +0200 Original-Received: from localhost ([127.0.0.1]:33365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKPN4-0001wy-Rh for ged-emacs-devel@m.gmane.org; Sat, 27 Apr 2019 11:36:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKPMQ-0001wt-Vm for emacs-devel@gnu.org; Sat, 27 Apr 2019 11:35:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKPMP-0004rY-Rt for emacs-devel@gnu.org; Sat, 27 Apr 2019 11:35:30 -0400 Original-Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:38865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hKPMP-0004qg-Aq for emacs-devel@gnu.org; Sat, 27 Apr 2019 11:35:29 -0400 Original-Received: by mail-io1-xd2d.google.com with SMTP id y6so5420767ior.5 for ; Sat, 27 Apr 2019 08:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unitn.it; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=81CbOcy2vhtFt4NIyI2fD73bvXMIQ+9QJm6DrTXzO2E=; b=e6R96WhJ1HjzkMLsXpANtb0nrMPbxADY8bfpXO8YfIFsfkdisBjF1qlBAARXDToeWw A8BUubqu/r3igxqhkOvnP61BcFZBj5L+MhfWKxop3veKycSbbfo6VkYl9TarlpZgXWk+ iLnVhYKVRUotbA4U+Foa5l53rz0pFYqEy86rI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=81CbOcy2vhtFt4NIyI2fD73bvXMIQ+9QJm6DrTXzO2E=; b=VHvTfN5KG+MPdM8EPzLZF0hlP6ApDCb8xgG7+Hqmh3kRxA1t3g8hP7l7+1GlV49mRt xHf7jesBu5LJFEmX/LOLtElv+bOj7CEn4YscYFel/L5H1lOx7jfChCKQ7yN0x/oxtlFM p/cYlSQm2oSe04USdrzF2WZOi4FRtcXuFg7nrAQ8Yyg6/uvFZRYmZCnT54M7RkULtp4Z tSlYdABa62JfQhDeKUziMND0ZdgSDWVvNDbx6vbYCZyZk4cHpAiLYlHbPX8yG/xjpbzX ZqMgwWIDAtCs1jcG5DN0FZh8TPNlzNmMP/n/bPlfQFJ6ujsTYR9vmZABSiecQNaph1/U Hdrg== X-Gm-Message-State: APjAAAXjLkQhnV7tmcJAfXvCXTkCJMsr4NpPEvBDxeBB/p7ho+3RDVQa 3BjnzemvTXsvWRsyPdMX7lehMw1wwG+ZI6ECpd8D X-Google-Smtp-Source: APXvYqwLLYaXalVaNLWbvC4EzpK9VqnEP5ZdysLv0pEWSrY+d2RgYkvEn8A1qMFQQ2b6owGzLcUvd9mK3rgoXYJS4nI= X-Received: by 2002:a5d:9cd6:: with SMTP id w22mr12801879iow.289.1556379328044; Sat, 27 Apr 2019 08:35:28 -0700 (PDT) In-Reply-To: <20190427113734.GA4822@ACM> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2d 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:235990 Archived-At: Hi Alan, On Sat, Apr 27, 2019 at 1:37 PM Alan Mackenzie wrote: > > Hello, Tadeus. > > On Fri, Apr 26, 2019 at 22:15:28 +0200, Tadeus Prastowo wrote: > > I have not made any report since I don't feel like sparing my time to > > collect some data for the report now that switching to text-mode does > > the trick. So, since you are already at it, perhaps you may want to > > find out why even scrolling the buffer in cc-mode is very slow when > > visiting the file at > > http://git.savannah.nongnu.org/cgit/tice.git/plain/tests/v1/test-v1_internals_program.cpp? > > You've submitted a bug report now. :-) I realize that now I have enough real data :-) > > Specifically, I built master at commit > > 82fc8ca6ba179596928db614ab903e44968ef44e and fired the result with > > `emacs -Q' to visit the file locally. Then, to experience the > > sluggishness, I pressed M-> followed by M-v several times. To further > > experience it, I started to edit some template parameters, such as > > changing `node1' to node `node5' in line 680. > > 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. > 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