Calc: speed up math-read-preprocess-string (bug#67536)
`math-read-preprocess-string` is one of the bottlenecks of `calc-eval` and was unnecessarily slow even with no substitutions made. This affected org-mode in particular, where `calc-eval` is called repeatedly to recalculate tables. Reported by Raffael Stocker who also wrote the unit tests here. * lisp/calc/calc-aent.el (math--read-preprocess-re-cache): New. (math-read-preprocess-string): Use math--read-preprocess-re-cache, first computing it if necessary. * test/lisp/calc/calc-tests.el (calc-math-read-preprocess-string): New test.
Showing
Please register or sign in to comment