From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'. Date: Mon, 14 Mar 2016 18:46:21 +0000 Message-ID: <20160314184621.GH1894@acm.fritz.box> References: <20160312170839.GE2572@acm.fritz.box> <20160312215839.GC10781@acm.fritz.box> <20160313175922.GE1871@acm.fritz.box> <0ce1b5a5-6892-47ad-03d4-d4c2ba2bea54@yandex.ru> <20160314122330.GC1894@acm.fritz.box> <20160314172940.GG1894@acm.fritz.box> <04defc46-af0c-6345-1570-83c1ae4ce14f@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457981050 8271 80.91.229.3 (14 Mar 2016 18:44:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 18:44:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 14 19:44:01 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1afXTD-0000z9-Kr for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 19:43:59 +0100 Original-Received: from localhost ([::1]:43395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXTD-0007eH-5c for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 14:43:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXSz-0007dr-MP for emacs-devel@gnu.org; Mon, 14 Mar 2016 14:43:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afXSw-0002zE-4N for emacs-devel@gnu.org; Mon, 14 Mar 2016 14:43:45 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:24827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXSv-0002z3-RL for emacs-devel@gnu.org; Mon, 14 Mar 2016 14:43:42 -0400 Original-Received: (qmail 91474 invoked by uid 3782); 14 Mar 2016 18:43:40 -0000 Original-Received: from acm.muc.de (p579E920E.dip0.t-ipconnect.de [87.158.146.14]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 14 Mar 2016 19:43:39 +0100 Original-Received: (qmail 5620 invoked by uid 1000); 14 Mar 2016 18:46:21 -0000 Content-Disposition: inline In-Reply-To: <04defc46-af0c-6345-1570-83c1ae4ce14f@yandex.ru> User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201738 Archived-At: Hello, Dmitry. On Mon, Mar 14, 2016 at 07:52:27PM +0200, Dmitry Gutov wrote: > On 03/14/2016 07:29 PM, Alan Mackenzie wrote: > > CC Mode doesn't use syntax-ppss. It would be too much work to put it in, > > particularly as that function's future is unclear. > Could you please avoid FUD like that? There's no FUD in my last paragraph, it's an accurate representation of the facts. I am not prepared to spend the time needed to adapt CC Mode to use syntax-ppss, and wouldn't be even if it worked properly. > >> IIRC, Stefan posted a patch, which was like 10 lines long. > > Sorry, patch for what? I've lost the context. > That one: > http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg00593.html > http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg00619.html OK. Stefan posted such a patch. Now what was your point? > Any other grunt work I can assist with? I'm still trying to work out the point you're trying to make. > >> Could you please try it already, so we can move on to discussing the > >> actual performance problems of syntax-ppss, instead of theoretical ones? > > It would be a lot of work. Perhaps you might like to undertake it. > Applying a patch and doing the measurements is a lot of work? Ah, so by "it" in "please try it already" you meant "apply Stefan's patch". That wasn't clear. Sorry. Yes, applying that patch and doing measurements would be a lot of work. You're welcome to do it if you're interested enough. I have tried out Stefan's patch, and for the vast majority of comments on which it actually works, I've no doubt it will work fast enough. Its speed isn't the issue. Stefan's patch doesn't actually fix what I see as the root cause of bug #22884, namely that comments get scanned backwards. At some time in the future this backward scanning will cause more bugs. What has been tried is Martin Rudalics's `foo' and `bar' functions (which repeatedly perform `c-end-of-defun' and `c-beginning-of-defun' respectively). I'm not the only person who has noticed a dramatic increase in speed for the comment-cache branch in these (unrepresentative) tests. If you're interested, look at some of the timings in the posts branching off of Martin's first post in this thread. [ .... ] > >> How do these timings translate into whole seconds of waiting after > >> pressing '/'? > > They don't. It was CC Mode's indentation engine's scanning, not the raw > > parse-partial-sexp scanning. > I guess we found the problem, then. And the cache's performance is > unlikely to change much. It will make no difference to the scenario in #22884, no, and it was never envisaged that it would. What all these things have in common is problems caused by scanning comments backwards. -- Alan Mackenzie (Nuremberg, Germany).