all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: casouri@gmail.com, 59738@debbugs.gnu.org
Subject: bug#59738: c-ts-mode is slow with large buffers.
Date: Sun, 11 Dec 2022 21:14:03 +0200	[thread overview]
Message-ID: <831qp5u51g.fsf@gnu.org> (raw)
In-Reply-To: <Y5Yj8hfujZnIPpDA@ACM> (message from Alan Mackenzie on Sun, 11 Dec 2022 18:39:46 +0000)

> Date: Sun, 11 Dec 2022 18:39:46 +0000
> Cc: casouri@gmail.com, 59738@debbugs.gnu.org, acm@muc.de
> From: Alan Mackenzie <acm@muc.de>
> 
> > It is impossible to debug Emacs efficiently on the C level using the
> > optimized build.  So yes, I'm using unoptimized builds quite a lot.
> 
> I use an optimised build for running and debugging at the Lisp level.
> Occasionally I need C debugging, and so run in an "ordinary" debugging
> build (3 times as slow) on these occasions.  I think I've only once or
> twice needed a super-slow build (with --with-enable-checking=all) for
> debugging.
> 
> My question was to enquire as to whether you actually really need the 10x
> as slow build most of the time, or whether the normal 3x as slow (normal
> debugging) build or even an optimised build would suffice most of the
> time.

I gave you my answer, based on many hours of debugging hard problem
and on a lot of gray hair.  Debugging optimized code is unreliable, at
least with GCC and GDB.  There are tricky bugs whose debugging
requires setting up complex traps and sophisticated breakpoint
conditions.  It takes time to find these tricks, and even a single
variable which is "optimized out" or a call to a function that cannot
be stepped into due to inlining and moving code around can ruin a long
and frustrating debugging session.  I cannot afford wasting my time
that way.

That the DWARF data generated by GCC is either not expressive enough
to tell the whole story, or GDB is not smart enough to interpret it,
is IMNSHO the greatest disaster that happened to the GNU Project.  Why
The Powers That Be don't consider it a grave problem, I cannot
imagine.  I'm old enough to remember that with GCC 2.7.2 I used to
debug optimized programs without any problems -- and it was a welcome
feature that made GCC stand out compared to the other compilers back
then, with which you simply couldn't debug optimized code.

> > I disagree.  Both C and C++ are still evolving, and their syntax and
> > semantics don't become simpler.  People post bug reports against CC
> > Mode which involve some tricky syntactical constructs all the time.
> 
> Yes.  It remains to be seen if the tree-sitter grammars handle these
> unusual constructs effortlessly.  I somehow suspect it won't be as simple
> as all that.  Yuan has already raised a bug in the C grammar where it
> doesn't handle packet-rrc.c correctly.

If this proves to be a serious problem, eventually someone on our team
will start making changes in the grammar files.  It isn't rocket
science, after all, given that the parsing itself is done elsewhere.





  reply	other threads:[~2022-12-11 19:14 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
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 [this message]
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=831qp5u51g.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.