GNU bug report logs - #69071
Emacs master branch: c-ts-mode is slow with large C functions.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Mon, 12 Feb 2024 11:41:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 69071 <at> debbugs.gnu.org
Subject: bug#69071: Emacs master branch: c-ts-mode is slow with large C functions.
Date: Mon, 12 Feb 2024 14:14:05 +0100
Alan Mackenzie <acm <at> muc.de> writes:

> Hello, Emacs.
>
> Using Emacs master:
>
> c-ts-mode is slow on large C functions when editing towards the end of
> such a function.
>
> As an extreme example, there is a function proto_register_rrc in the
> file packet-rrc.c which is part of Wireshark.  This file is "available"
> from Github, but sadly no longer freely available - you need to allow
> Microsoft's scripts to run on your machine.  I'm willing to send this
> file by email to anybody who needs it.  It is almost 10 MB in size.

Assuming we are talking about the same 10 MB file:

  $ wget https://raw.githubusercontent.com/wireshark/wireshark/master/epan/dissectors/packet-rrc.c

or

  $ git clone --depth 1 https://github.com/wireshark/wireshark 
  $ find wireshark -name packet-rrc.c

might help?

I'd suggest heeding that repository's disclaimer and using the canonical
GitLab repo instead of the read-only GitHub mirror, but odds are
gitlab.com's JS won't fare better on the freedom front.  Debian's mirror
might?

https://salsa.debian.org/debian/wireshark/-/blob/debian/master/epan/dissectors/packet-rrc.c

> proto_register_rrc is around 50,000 lines long, total size about 2¼ MB.
>
> Near the end of the function, after typing a character, there is a delay
> of between 9 and 10 seconds (on my 7 year old machine) before redisplay
> happens.  This is too long.  Some optimisation seems needed.
>
> On disabling font-lock-mode, the response becomes instantaneous.




This bug report was last modified 1 year and 188 days ago.

Previous Next


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