GNU bug report logs - #48871
27.2; Unusably slow in C# mode

Previous Next

Package: emacs;

Reported by: jan <rtm443x <at> googlemail.com>

Date: Sun, 6 Jun 2021 12:33:02 UTC

Severity: normal

Found in version 27.2

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: jan <rtm443x <at> googlemail.com>, Alan Mackenzie <acm <at> muc.de>
Cc: 48871 <at> debbugs.gnu.org
Subject: bug#48871: 27.2; Unusably slow in C# mode
Date: Sun, 06 Jun 2021 20:00:55 +0300
> From: jan <rtm443x <at> googlemail.com>
> Date: Sun, 6 Jun 2021 15:53:11 +0100
> Cc: 48871 <at> debbugs.gnu.org
> 
> I don't recall installing c# but may well have happened.
> >From package-list-packages:
> 
> csharp-mode        20210328.2004 installed             C# mode derived mode
> 
> Which does not say built-in so likely I did. Looking in the unzipped
> emacs 27.2 , no relevant *sharp* file in it, and did find it in the
> elpa directory, so I guess must have.
> 
> Started with -Q.  Did the M-x load-file for csharp-mode.el (FYI also
> had to do load-file for csharp-compilation.el before that to make it
> happy).
> 
> Finally got to load the C# file itself, exactly the same. No faster.
> 
> Troublesome C# file attached.

Thanks.

Alan, can you look into this?  It could be some problem in
csharp-mode, but the profiler says 97% of the time is spent in a CC
mode code, so maybe you can shed some light on this?

I see that almost the entire 6896-line file is enclosed in a single
"namespace LDB { ... }" block, maybe this is the reason?

Here's the main portion of a profile measured on my system from just
inserting 3 characters at BOB of the file attached by the OP.  An
unoptimized build of Emacs 28 took about 2 min(!) to process those 3
self-inserting characters.

	  8693  98% - command-execute
	  8693  98%  - call-interactively
	  8693  98%   - funcall-interactively
	  8690  98%    - self-insert-command
	  8627  98%     - c-before-change
	  8627  98%      - mapc
	  8627  98%       - #<compiled 0x1aaa1ff2c62de223>
	  8627  98%        - c-before-change-check-unbalanced-strings
	  8611  97%           c-pps-to-string-delim
	    10   0%         - c-syntactic-re-search-forward
	     2   0%          - c-beginning-of-macro
	     2   0%             back-to-indentation
	     1   0%            #<compiled 0x4f47ef635173>
	     1   0%           c-clear-syn-tab
	    63   0%     - c-after-change




This bug report was last modified 4 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.