all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: acm@muc.de, 59738@debbugs.gnu.org
Subject: bug#59738: c-ts-mode is slow with large buffers.
Date: Wed, 07 Dec 2022 19:23:38 +0200	[thread overview]
Message-ID: <83edtb3z6t.fsf@gnu.org> (raw)
In-Reply-To: <87E351E0-2EE2-434A-9609-86506D2F263D@gmail.com> (message from Yuan Fu on Tue, 6 Dec 2022 20:56:13 -0800)

> Cc: 59738@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> Date: Tue, 6 Dec 2022 20:56:13 -0800
> 
> 
> Alan Mackenzie <acm@muc.de> writes:
> 
> > Hello, Emacs.
> >
> > In an up to date (2022-11-30) master started as $ emacs --no-desktop:
> >
> > The file .../drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_sh_mask.h
> > in the Linux source tree is 6.8 MB big, consisting of a large number of
> > #defines and comments, but nothing else.
> >
> > To scroll through it in c-ts-mode takes a little over 26 minutes on my
> > system.  By comparison, in C Mode it takes 31 seconds.  There would
> > appear to be a need for some optimisation in c-ts-mode, here.
> >[...]
> Ah, the lovely packet-rrc.c file.

No, this is a different file, dce_12_0_sh_mask.h.  It is a header file
which only has preprocessor #define lines.  I'm puzzled why this
presents such a great difficulty for tree-sitter.  Could you take a
look what happens with that file?

> We had some discussion of it in
> bug#59415, basically it contains some syntax that screws tree-sitter up.
> The block initialization you see makes tree-sitter into erroneously
> generating a very tall tree: it recognizes all the opening bracket and
> ignores (almost) all the closing brackets. That causes operations on the
> tree to be much much slower than it normally is.

Right, but with a long series of #define lines there should be no
parse tree at all...





  reply	other threads:[~2022-12-07 17:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 11:50 bug#59738: c-ts-mode is slow with large buffers Alan Mackenzie
2022-12-03 10:37 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-07  4:56 ` Yuan Fu
2022-12-07 17:23   ` Eli Zaretskii [this message]
2022-12-08  0:40     ` Yuan Fu
2022-12-08 20:37       ` Eli Zaretskii
2022-12-10 21:34         ` Alan Mackenzie
2022-12-10 23:14           ` Yuan Fu
2022-12-11  7:25             ` Eli Zaretskii
2022-12-11 13:22             ` Alan Mackenzie
2022-12-11 16:38               ` Dmitry Gutov
2022-12-11  6:45           ` Eli Zaretskii
2022-12-11 17:13             ` Alan Mackenzie
2022-12-11 17:38               ` Eli Zaretskii
2022-12-11 18:39                 ` Alan Mackenzie
2022-12-11 19:14                   ` Eli Zaretskii
2022-12-13  1:20           ` Stefan Kangas
2022-12-07 14:34 ` Eli Zaretskii
2022-12-07 14:58   ` Eli Zaretskii
2022-12-07 15:46   ` Alan Mackenzie
2023-01-07 23:08 ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83edtb3z6t.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59738@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=casouri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.