From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug#20352: Factor 2 slow down of font-locking in c-mode Date: Sun, 03 May 2015 22:13:48 -0400 Message-ID: References: <20150417191005.4119.qmail@mail.muc.de> <20150418094552.GA4182@acm.fritz.box> <20150503213303.GA4997@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430705655 13870 80.91.229.3 (4 May 2015 02:14:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 May 2015 02:14:15 +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 May 04 04:14:08 2015 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 1Yp5tY-0006dC-0U for ged-emacs-devel@m.gmane.org; Mon, 04 May 2015 04:14:08 +0200 Original-Received: from localhost ([::1]:60801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yp5tX-0002rv-Bn for ged-emacs-devel@m.gmane.org; Sun, 03 May 2015 22:14:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yp5tK-0002ro-Lb for emacs-devel@gnu.org; Sun, 03 May 2015 22:13:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yp5tF-0001GX-IH for emacs-devel@gnu.org; Sun, 03 May 2015 22:13:54 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:55953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yp5tF-0001GM-F2 for emacs-devel@gnu.org; Sun, 03 May 2015 22:13:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRFpYts/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCwsOJhIUGA0kiBOiEYwNYwODPgMDGoNTBKNjhFg X-IPAS-Result: AgUFAGvvdVRFpYts/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCwsOJhIUGA0kiBOiEYwNYwODPgMDGoNTBKNjhFg X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="118164550" Original-Received: from 69-165-139-108.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.139.108]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 May 2015 22:13:49 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id ED63FAE12D; Sun, 3 May 2015 22:13:48 -0400 (EDT) In-Reply-To: <20150503213303.GA4997@acm.fritz.box> (Alan Mackenzie's message of "Sun, 3 May 2015 21:33:03 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:186171 Archived-At: > Indeed. Some while ago, you were musing on putting syntax-ppss, or > equivalent, into syntax.c, thus rendering > open-paren-in-column-0-is-defun-start unnecessary and obsolete. This > would speed up or improve the accuracy of, in particular, back_comment > and the stacks of things which depend upon it. > Is this enhancement still intended? Not in the short term, no. I've toyed with it, but there's a problem: syntax-ppss's caching relies on the syntax-table being constant. This usually works fine because the callers "know" to call syntax-ppss outside of with-syntax-table (I guess in reality they don't really know, but they happen to do that because they call syntax-ppss fairly early on), but it's not uncommon for Elisp code (definitely including CC-mode) to use with-syntax-table around calls to forward-sexp/comment, so calling syntax-ppss implicitly from within those functions exposes this underlying syntax-ppss limitation. IOW, it can't be done until we figure out how to make syntax-ppss handle syntax-table changes. Stefan