Ihor Radchenko 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).