Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers

From: Ihor Radchenko <[email-masked]>
Date: Tue, 13 Dec 2022 18:03:49 +0000

Eli Zaretskii <[email-masked]> writes:

>> If I read the backtrace correctly, something in my custom mode-line is
>> triggering Fmatch_data that creates markers.
>
> Yes, you have sone :eval form in the mode line, it seems?

Yes. For example, I call

(defun yant/vc-git-current-branch ()
    "Get current GIT branch."
    (and vc-mode
	 (cadr (s-match "Git.\\([^ ]+\\)" vc-mode))))

with s-match wrapping its code into save-match-data.         

> Calling xbacktrace will show a Lisp backtrace, which could be
> educational here.

(gdb) xbacktrace
Undefined command: "xbacktrace".  Try "help".

I am not sure what you mean by xbacktrace.

Also, as Stefan pointed, number of markers may or may not be a problem
here. However, I had a similar issue even with Emacs 28 when we tested
creating a huge number of markers in buffer + re-search-forward. I ended
up seeing similar perf logs that time.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>