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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 Dec 2022 16:12:53 +0200

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> Date: Wed, 14 Dec 2022 13:39:43 +0000
> 
> How can I find the number of buffer markers?

Compile Emacs with -DMARKER_DEBUG, and then you can call count_markers
from GDB:

  (gdb) print count_markers(current_buffer)

But you need to make sure current_buffer is the buffer you are
interested in.  One trick is to do this:

  (gdb) break Fredraw_display

and then type "M-x redraw-display" with the buffer in the selected
window.  Then call count_markers as above, and it should return the
number of markers in the current buffer.