unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Raffael Stocker <r.stocker@mnet-mail.de>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	67536@debbugs.gnu.org
Subject: bug#67536: 29.1; Calc mode's math-read-preprocess-string conses unnecessarily
Date: Sun, 3 Dec 2023 11:43:07 +0100	[thread overview]
Message-ID: <1B1320A5-9FE9-4747-8A07-6F7FF71E8840@gmail.com> (raw)
In-Reply-To: <yplmmsusbdf4.fsf@mnet-mail.de>

2 dec. 2023 kl. 20.26 skrev Raffael Stocker <r.stocker@mnet-mail.de>:

> Is this the case? As ‘mapc’ is implemented directly in C and ‘dolist’
> falls back to ‘while’, I thought it would be the other way around.

It's the function calls that are expensive. `dolist` just expands to a loop.
It's even worse if the lambda expression accesses variables outside (which wasn't the case here) because that forces creation of a closure.

> However, I checked your proposed version and there is an issue with
> replacement of sub- and superscripts.

Look at that, I got the semantics wrong. Sorry about that. Here's a new patch.
A lot less pretty this time.

In any case, make sure to include unit tests in your final patch.

The whole problem is compounded by the public variables (math-read-replacement-list etc) that we somehow feel a need to keep unchanged just in case some user modifies them, despite this almost certainly never happens.






  reply	other threads:[~2023-12-03 10:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 21:29 bug#67536: 29.1; Calc mode's math-read-preprocess-string conses unnecessarily Raffael Stocker
2023-11-30  7:00 ` Eli Zaretskii
2023-11-30 18:28   ` Raffael Stocker
2023-11-30 19:14     ` Eli Zaretskii
2023-12-01 17:34       ` Raffael Stocker
2023-12-01 18:12         ` Eli Zaretskii
2023-12-01 21:10           ` Raffael Stocker
2023-12-02  8:03             ` Eli Zaretskii
2023-12-02 14:56               ` Mattias Engdegård
2023-12-02 19:26                 ` Raffael Stocker
2023-12-03 10:43                   ` Mattias Engdegård [this message]
2023-12-03 11:13                     ` Raffael Stocker
2023-12-03 11:58                       ` Mattias Engdegård
2023-12-05 18:14                     ` Raffael Stocker
2023-12-16  9:40                       ` Eli Zaretskii
2023-12-18 10:55                         ` Mattias Engdegård
2023-12-18 11:39                           ` Raffael Stocker
2023-12-19 16:16                             ` Mattias Engdegård
2023-12-19 17:09                               ` Raffael Stocker
2023-12-19 18:15                                 ` Mattias Engdegård

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=1B1320A5-9FE9-4747-8A07-6F7FF71E8840@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=67536@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=r.stocker@mnet-mail.de \
    /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).