From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43631: 28.0.50; CC Mode multiline strings grinds performance to a halt Date: Mon, 28 Sep 2020 21:41:12 +0200 Message-ID: <87k0wd4rl3.fsf@thornhill.no> References: <87lfgwwzw6.fsf@thornhill.no> <83pn68rcio.fsf@gnu.org> <87eemo4sor.fsf@thornhill.no> <83o8lsr6vq.fsf@gnu.org> <877dsgle4h.fsf@thornhill.no> <837dsgqzr1.fsf@gnu.org> <87pn67312v.fsf@thornhill.no> <20200928193325.GA7626@ACM> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39534"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43631@debbugs.gnu.org, Eli Zaretskii To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 28 21:43:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMz3G-000AAp-9P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 21:43:10 +0200 Original-Received: from localhost ([::1]:46854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMz3F-0000QE-C3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 15:43:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMz38-0000Q4-7q for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMz37-0003Tx-Sk for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMz37-0002aq-QQ for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Sep 2020 19:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43631 X-GNU-PR-Package: emacs Original-Received: via spool by 43631-submit@debbugs.gnu.org id=B43631.16013221349913 (code B ref 43631); Mon, 28 Sep 2020 19:43:01 +0000 Original-Received: (at 43631) by debbugs.gnu.org; 28 Sep 2020 19:42:14 +0000 Original-Received: from localhost ([127.0.0.1]:54054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMz2L-0002Zo-VL for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:42:14 -0400 Original-Received: from out0.migadu.com ([94.23.1.103]:42424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMz2J-0002Zf-9R for 43631@debbugs.gnu.org; Mon, 28 Sep 2020 15:42:12 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1601322129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=O+9BfP63ZghOm1+xkUUEpgtCtEeoRSuQk4ZnNxAnelI=; b=eE1Wq1e1omsj+/bYL6jgnNHqEGNZ7r5RBcBSUbgn54R8msjU5Nh+TShvANYJyH5UpmfTJv Q1ROZ0E33/sBmfdlcPga9riZ6cuQPnIVeid1r5+nD+TFAcLCpOfP7XDJPpgwyHXWSvoBjR w18foHjoZyGChxnKbP84573cv4bmonl6sfyHdbVsj9yaYavFUdv36RwQsC4ZG/ELRxRBVP vZvYgW64E8tG6ZaBuSkkuWmjWG8I1tFIuphFmz5akyJTzzOSoaULPojGV6tkiiSgt7N6be UZEGeqcTa/XTJ5R2jeJ7uZffqWcmOYSf00fsVdNpJGC2coLuq9kINwBAG4efYQ== In-Reply-To: <20200928193325.GA7626@ACM> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189223 Archived-At: Alan Mackenzie writes: > Hello, Theo. > [...] >> I see that when I remove 'c-before-change-check-unbalanced-strings from >> 'c-get-state-before-change-functions' the performance degradation >> ceases. I'm not sure what else is affected by that change, so not sure >> if that can be counted as a fix as far as 'csharp-mode' is concerned. > > I would strongly recommend you not to make such a change, at least not > without a good deal of matching changes elsewhere. ;-) Yeah, I put it back in some time ago ;) > > It seems the bit in c-b-c-check-unbalanced-strings dealing with > multiline strings was written on the assumption that buffers containing > such would be small. > > With multiline strings, _any_ change involving quote characters can flip > the string/non-string characterisation from point all the way to the end > of the buffer. In the worst case scenario, this potentially big region > needs to be analysed and have syntax-table text properties throughout > the entire region changed. > > The current problem is that c-b-c-check-u-strings is doing this analysis > for every buffer change. This was easier to code, but has led to > performance problems on buffers which aren't small. The solution to > this will have to involve restricting this analysis to when quote marks > or the c-multiline-string-start-char get inserted or removed. That way, > there should only be an occasional and tolerable delay when one of these > characters is inserted/removed. > > I'll be looking at this in the coming days. > Thats very interesting, and thanks! -- Theo