From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Bug #25608 and the comment-cache branch Date: Mon, 6 Feb 2017 03:28:44 +0200 Message-ID: <883690aa-5749-1c6b-bcd7-7404dd0d9bf0@yandex.ru> References: <20170202202418.GA2505@acm> <9d0b3156-e8b2-c2d8-0d0c-a025861e5e0c@yandex.ru> <20170203164457.GB2250@acm> <20170204110259.GB2047@acm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1486344636 29918 195.159.176.226 (6 Feb 2017 01:30:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 01:30:36 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 02:30:32 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caY8V-0007cK-Vy for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 02:30:32 +0100 Original-Received: from localhost ([::1]:45127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caY8b-0003Qj-E4 for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 20:30:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caY6w-0002s4-1K for emacs-devel@gnu.org; Sun, 05 Feb 2017 20:28:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caY6v-00066w-3f for emacs-devel@gnu.org; Sun, 05 Feb 2017 20:28:54 -0500 Original-Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:33058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caY6r-000666-40; Sun, 05 Feb 2017 20:28:49 -0500 Original-Received: by mail-wr0-x243.google.com with SMTP id i10so2132056wrb.0; Sun, 05 Feb 2017 17:28:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A8O+J5dvBVQFUFTFQDOMNY00zQBVczbDViOXvMTDnc8=; b=h1pig3i4+gcJkzciwygU4+cY1DVv2v39KrfcF1gBlWfodMQUQlpjiovhLF3p9CDeAA rNWKRxrH21AqIsLQNyfUYEwDdZYXih2mPhHXXuRXqjztdh2iXkJ/wB0hq0KjYrQdg54K D24k1+3hP31ggMBuwMUz/boCwK4sPRU707PrymyT9catRiNIEwNCyCbhpHe5fik0Opsv sS1ID2LOQlKgu63zSflkblF2FDovCOaTSuStEshqcW/UcK6ySV6ZRLncq9AJ9TaOMOiY bD6bOBenaaRqzR9SBSVaHK3U68y6DINCRT+vXtUU+lCwui+E5uKkoSp1VOaUwPUlS8bd qUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A8O+J5dvBVQFUFTFQDOMNY00zQBVczbDViOXvMTDnc8=; b=nRmhbK9MnaMEjop7S3Isp35DJoEIR4sGyrwOnlQbfyTs0Be7grotjj85aysP+c8YyC MbSAUDJAYvkC/KzwT1j9bkQ5o4CI2tKXrIYgxlj30njlXc5JCr7//gGqCHixFB+whk2y G+oopEKBA+HCy2A5ziIKxiAq2sL69KD9cGUKmEqeINxqe5vvturLDE789Sn+yRth60uD 21Y3uWTH4lTzplnp4+W3aDFO1R6+20KX4+dK/nWBeZfUc3tpFlQnUT9nBoku6A5WqxNu aCF2nOSPbrQqxr1lliZhdBbRhc+7zWyR0zuQ1ePIDaF8kylrnBAY2rW6EDP2R/SLWQE8 4m/Q== X-Gm-Message-State: AMke39ld+FIN6b4mOvgxASG0e/c5dsjB9YE4QuTnkAaNo7tY3mbSjOm3LW5zAjkqcy2Wfg== X-Received: by 10.223.135.201 with SMTP id c9mr6980763wrc.139.1486344527690; Sun, 05 Feb 2017 17:28:47 -0800 (PST) Original-Received: from [10.8.0.14] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by smtp.googlemail.com with ESMTPSA id 17sm57448505wru.16.2017.02.05.17.28.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Feb 2017 17:28:47 -0800 (PST) In-Reply-To: <20170204110259.GB2047@acm> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::243 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:212011 Archived-At: Hi Alan, On 04.02.2017 13:02, Alan Mackenzie wrote: > I think it would be useful to post the actual patch here, so it can be > more easily discussed, and to be easier for people who want to try it > out to get to it. I'd rather it stays in one place, along with any further revisions, if needed. That should cause less confusion in the long run. For any casual observers in this discussion who don't want to follow the links: the patch touches src/syntax.c, and it's 20 lines long. > syntax-ppss being too slow was its use in a specific circumstance. That > was trying to use it in place of comment-cache's cache mechanism, but > otherwise using comment-cache. That would result in ~2 orders of > magnitude slowdown in backward_comment. Ah, so that's what you were arguing against? Does comment-cache code contain some other functionality that we'd want to retain while using the syntax-ppss cache? Something that makes performance overhead of syntax-ppss a problem still? >>> The "alternative patch" didn't scan comments correctly all the time >>> when I looked at it, just as the current back_comment doesn't. > >> Please remind us of the specific problems it has. > > In the following test case (same as in my other post) the "alternative > patch" doesn't work. Narrow the buffer with point-min at the indicated > position. Put point at EOL. Try M-: (forward-comment -1). This fails. > > char foo[] = "asdf asdf" "asdf"; /* "asdf" */ /* */ /* '"'" */ > ^ > > . Thank you for the reminder. But do you have any examples that do not involve narrowing? Reconciling syntax-ppss with narrowing is a subject of a separate thread (one that's regrettably stalled for a while, but I'll get back to it soon). As soon as it's resolved, the Alternative Patch should not have this problem anymore either. > Using M;- (time-scroll) from the start of xdisp.c, and (time-scroll t) > from its end (having cleared caches by typing a character at BOB), I get > these timings > > forward backward > master 34.51s 36.43s > comment-cache 33.68s 32.81s > "alternative patch" 35.49s 36.05s Thanks! > It would seem that differences in speed are not big enough to make any > decision on that basis. Does that just leave the narrowing issues, or is there something else?