From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov 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 21:33:25 +0200 Message-ID: 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> <20160314184621.GH1894@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1457984025 25991 80.91.229.3 (14 Mar 2016 19:33:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 19:33:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 14 20:33:40 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 1afYFH-00073k-Rm for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 20:33:40 +0100 Original-Received: from localhost ([::1]:43625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYFH-0000ho-7A for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 15:33:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYFB-0000dz-MR for emacs-devel@gnu.org; Mon, 14 Mar 2016 15:33:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afYF8-0007YL-C9 for emacs-devel@gnu.org; Mon, 14 Mar 2016 15:33:33 -0400 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:36879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYF8-0007YA-2c for emacs-devel@gnu.org; Mon, 14 Mar 2016 15:33:30 -0400 Original-Received: by mail-wm0-x22b.google.com with SMTP id p65so116740228wmp.0 for ; Mon, 14 Mar 2016 12:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=QLseWG1ZjAa1ZW1guQubXWpt5laavU08AcEiZZ/M1Is=; b=DfcZPGcc8vXluPPr40NGDDk1pNvIGJIzE5OFwGDXyVZoboIrJRslF+h5u/+OBOWtbb MwuZ1u2f/bNir3SApSyFHMi0am7vbCn3ByB5bfJRclR7BXvbEw+oZ0mKUvwmdVseF/OU uqUIuKA8AN9tfF3mxHbBS7h4IRo0MfOevExqlReWIQ0ZgMZBqGZnhw4NxJopbo+I8x++ ZvgvkGy1gWYR23AjcHX5YshJOSLcPKO7e2rK9slcb+ypz95pw08KTIBr9D/3nqxcGrDS QdPoIOtl/x3m+gEpHB4WUbhYZqUv8nZQjT8tuj9dDdJ1TOdeQZT+1omc2wxvnRv/BsRX wApA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=QLseWG1ZjAa1ZW1guQubXWpt5laavU08AcEiZZ/M1Is=; b=UpZsjeLMTYix4N+wA5lNogrXNY18F32Ks5yw5CVk2KbADe/jKTIZLJExH+6aPqzs7Q 8VQMBWEeMV6Q7yfM2+MgVflS2+ck/rIyxT+hasuFo7pxlpQG2C9w80no5isQexv2ZT0w HDW7F4YBDU8HcMxMN4AJlMXF1CELZYew2LB27xtjshfa2hEAacC/GBHwl1UiDSpZn9iY QlOjZCLQrnRRhEyGKv1xDFXi/JRFf+ZK6RfHnWedPwm2N+wJ2lsQkSNiaoIGfWSA5ZgG 4tIKsV1ahmvTKNbnMPLYQA/SduDIGr9OWhgO7qJQHHFMZmqEw8lttPp/OU+kFOwmCvK0 ufcw== X-Gm-Message-State: AD7BkJI9R0HkvM4jAv5JNc4H+jZPjO3OdiwFDw845smNc07DRyqrP5kbPIFoLvRyAVwNzA== X-Received: by 10.28.170.137 with SMTP id t131mr20423036wme.32.1457984008753; Mon, 14 Mar 2016 12:33:28 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id lz5sm23727664wjb.5.2016.03.14.12.33.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2016 12:33:27 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <20160314184621.GH1894@acm.fritz.box> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b 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:201753 Archived-At: Hi Alan, On 03/14/2016 08:46 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. Not at all. syntax-ppss's future is rather clear, and it's here to stay, after years of successfully being in use. > 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. That's a separate issue. Right now we're discussing how to best implement "comment cache", and if it's needed at all. > I'm still trying to work out the point you're trying to make. Apparently, the point is that you've been offered a simpler solution for the same problem, and that you basically ignored it. > Ah, so by "it" in "please try it already" you meant "apply Stefan's > patch". That wasn't clear. Sorry. Isn't what this subthread is about? The alternative approach? > 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 might, but you'd first have to let me know what to test. If the comment cache patch doesn't actually help with 22884, why are we even discussing it? > 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. Ah, so the speed advantage of using text properties is not that much of advantage. Correct? > 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. Can you produce a test case where it fails? This time without involving narrowing, please. > 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. Do you have any non-synthetic tests? (while (not (eobp)) (end-of-defun)) is not something that is likely to occur is a user's interation with Emacs with any regularity. For a synthetic test, by the way, a 60%-80% increase in performance is not that impressive. > 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. syntax-ppss helps with avoiding that.