Subject: 28.0.50; CC Mode multiline strings grinds performance to a halt
From: Theodor Thornhill <[email-masked]>
To: [email-masked]
Date: Sat, 26 Sep 2020 13:17:29 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello there!

While creating a new mode derived from CC Mode, we noticed performance
is affected heavily when setting a character for
'c-multiline-string-start-char'. There is a discussion around this that
can be found at https://github.com/josteink/csharp-mode/issues/164,
and we were given an easily reproducible repo for this. It is verified
to slow typing down both in 'csharp-mode', 'pike-mode' and in this test
case:
https://github.com/unhammer/csharp-mode/tree/164-repro

I think (unconvincingly) that some of the problematic code is situated
around line 2047 in 'cc-mode.el', but this is only a guess taken from
some light profiling.

The issue is described well on github, and I think me trying to
reiterate that here will only cause subtle confusions.

One thing of note is that you don't even have to have any multiline
strings for this performance hit to occur, meaning all 'csharp-mode'
files do suffer from this.

Let me know if something is still unclear, and I'll try to bring up some
more information.

All the best,
Theodor Thornhill