Subject: bug#48871: 27.2; Unusably slow in C# mode

From: Alan Mackenzie <[email-masked]>
Date: Sun, 6 Jun 2021 19:27:49 +0000

Hello, Jan and Eli.

On Sun, Jun 06, 2021 at 19:22:17 +0100, jan wrote:
> Ah... well... yeah...

> searching for "c-pps-to-string-delim" finds this
> <https://github.com/emacs-csharp/csharp-mode/issues/207>, similar to
> what I referenced in my initial post.
> Neither are very optimistic. If this is a wontfix I'll understand.

This is indeed a string problem in CC Mode.  More precisely, it's a
multi-line string problem, such being started in C# mode by @".  For
some very bad reason (which I've got written down somewhere) CC Mode is
scanning to the end of the buffer for each character inserted.  Sorry.

As a workaround, if you don't have any multi-line strings in your
source, put the following in your csharp-mode-hook:

    (setq c-multiline-string-start-char nil)

..  That should get rid of the excessive scanning for the time being.

I've spent much of the last few weeks adapting the C++ raw string
mechanism also to handle multi-line strings in other languages such as
C#.  I'm hoping to have it up and running soon.  Then, perhaps, the C#
Mode maintainer will incorporate it into C# Mode, which should be a
straightforward task.

> cheers

> jan

> On 06/06/2021, Eli Zaretskii <[email-masked]> wrote:
> >> From: jan <[email-masked]>
> >> Date: Sun, 6 Jun 2021 19:00:57 +0100
> >> Cc: Alan Mackenzie <[email-masked]>, [email-masked]

> >> Looks like strings doing it.

> > Well, the fact that c-pps-to-string-delim is the hot spot kinda says
> > that...

-- 
Alan Mackenzie (Nuremberg, Germany).