Subject: Re: bug#67536: 29.1; Calc mode's math-read-preprocess-string conses unnecessarily

From: Mattias Engdegård <[email-masked]>
Date: Sat, 2 Dec 2023 15:56:54 +0100

2 dec. 2023 kl. 09.03 skrev Eli Zaretskii <[email-masked]>:

> Mattias, any comments, or should I install this?

Well, the patch doesn't look too unreasonable so installing it would leave us better off than before.

Of course we may want to try to do better if this is really a bottleneck. The big job was to detect and locate the inefficiency -- thank you, Raffael! -- so his efforts were instrumental in any case.

There are minor points that could be addressed: `mapc` is often better replaced with `dolist`; the first position of a buffer is 1, not 0; and perhaps iterating through all elements of math-read-replacement-list isn't ideal.

Here's a variant which computes a single regexp to do the job and should cons a bit less.
Raffael, maybe you could see if this makes a difference in Org table performance.