bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ihor Radchenko
Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers
Date: Thu, 06 Apr 2023 11:49:52 +0000

Ihor Radchenko <yantar92@posteo.net> writes:

>> Did you try to see how the number of markers in the buffer evolves
>> with the up-time?
>
> Is there any way to get the number of buffer markers from Elisp?

I finally got back to this and implemented a small subr to count
number of buffer markers:

DEFUN ("buffer-markers", Fbuffer_markers, Sbuffer_markers, 0, 0, 0,
       doc: /* Return the number of markers in current buffer.*/)
  (void)
{
  struct Lisp_Marker *tail;
  int count = 0;

  for (tail = BUF_MARKERS (current_buffer); tail; tail  = tail->next)
    count++;

  return make_fixnum (count);
}

Then, I tracked how the number of markers evolves in my problematic
buffer when building agenda. On master and on Emacs 28 (where the agenda
is building 10x faster).

As you can see on the attached graph, the number of markers is ~1000, and
it is not significantly different for the two Emacs versions.

So, the number of markers itself does not look like the real culprit.

I have no better ideas for now except slowly bisecting Emacs (again).

Attachment: marker-count.png
Description: PNG image

-- 
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>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]