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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 06 Jun 2021 15:49:05 +0300

> Date: Sun, 6 Jun 2021 13:32:09 +0100
> From:  jan via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> C# mode is slow beyond to the point of being completely unusable. This
> seems to have started when I upgraded from emacs 26 to emacs 27.2. The
> file is ~220K. At the start of the file, typing takes 3 or 4 secs *per
> character* to appear (at the end of the file, instantaneous). It's
> forcing me to use visual studio to do all simple text editing and I
> don't like that.
> [...]
> Turns out emacs has a profiler, thought I'd try it.

Good start, thanks.

> Not sure what to do.

Post an example of a file where typing lags by several seconds, and
let's see what people here can tell about that.

But before that, start "emacs -Q", visit the C# file that gave you
such trouble, and try typing there.  If the lag disappears, then look
for some of your customizations that could explain the slow responses.