unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: The poor quality of Emacs's backtraces
Date: Mon, 17 Jul 2023 17:52:12 +0200	[thread overview]
Message-ID: <5382C438-D871-4C79-820C-DCA17C59CBCA@gmail.com> (raw)
In-Reply-To: <ZLG1Zk07Sv1wQ5on@ACM>

14 juli 2023 kl. 22.51 skrev Alan Mackenzie <acm@muc.de>:

> Aren't we always careful?  I wasn't intending to make anything slower
> (except, marginally, the handling of errors).

Your intent is not in doubt, but the execution path is so sensitive that seemingly minor changes often have outsized effect on performance. (This cuts both ways: there have also been optimisation opportunities in what appeared to be reasonably efficient code.)

Bug#64613 has been opened for this effort, and I intend to continue it shortly. I'm certainly open for ideas about how to solve the problem efficiently and effectively.

> I have working code implementing the putting of this extra information
> into backtraces.

Writing code is the easy part. What I'm wary about is rushing a solution -- your solution -- to a problem that hasn't yet been studied in sufficient depth, and with no regard to the costs involved: not just performance but also the fact that other people, myself included, will be the ones to maintain the feature for all foreseeable future.

The problem is compounded by our current suboptimal representation of closures: instead of the typical ⟨function, environment⟩ tuple, we represent them as copies of the function object with closed-over variables allocated separately and hacked into the (also copied) constant vector. Making that copied function object even bigger is the opposite of what we want to do.

There is also the question of what information should be there if any were to be added. For example, source location could arguably be more useful than function name.

But more importantly, since you said yourself that you would have been satisfied with a backtrace that included the faulting operation, and we agree that this is something we want in any case, wouldn't it make sense to begin there? The risk is much lower and it won't saddle us with irreversible maintenance costs.




  reply	other threads:[~2023-07-17 15:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:35 The poor quality of Emacs's backtraces Alan Mackenzie
2023-07-13 14:17 ` Christopher Dimech
2023-07-13 14:57 ` Mattias Engdegård
2023-07-14  8:00   ` Ihor Radchenko
2023-07-14  9:08     ` Mattias Engdegård
2023-07-14  9:18       ` Ihor Radchenko
2023-07-14 10:58         ` Alan Mackenzie
2023-07-14 10:56     ` Eli Zaretskii
2023-07-14 10:48   ` Alan Mackenzie
2023-07-14 12:35     ` Mattias Engdegård
2023-07-14 13:07       ` Alan Mackenzie
2023-07-14 18:06         ` Mattias Engdegård
2023-07-14 20:51           ` Alan Mackenzie
2023-07-17 15:52             ` Mattias Engdegård [this message]
2023-07-17 19:02               ` Alan Mackenzie
2023-07-17 19:50                 ` Ihor Radchenko
2023-07-18 11:19                   ` Alan Mackenzie
2023-07-18 11:54                     ` Ihor Radchenko
2023-07-18 13:57                       ` Alan Mackenzie
2023-07-19  8:05                         ` Ihor Radchenko
2023-07-19 10:33                 ` Mattias Engdegård
2023-07-19 15:45                   ` Alan Mackenzie
2023-07-14  1:10 ` Michael Heerdegen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=5382C438-D871-4C79-820C-DCA17C59CBCA@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).