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

From: Ihor Radchenko <[email-masked]>
Date: Wed, 14 Dec 2022 12:23:50 +0000

Stefan Monnier <[email-masked]> writes:

> I'd be interested to know how many iterations of the `for (tail =
> BUF_MARKERS (b);...` loop are executed on average during your
> `re-search-forward` (and how that average changes between runs of
> `re-search-forward`).

I did not get around to measure separate re-search-forward calls, but
total number of hits to CONSIDER (tail->bytepos, tail->charpos); during
benchmark-run is:

18      breakpoint     keep y   0x000055555578be74 in buf_bytepos_to_charpos at marker.c:353
	breakpoint already hit 4,245,365 times

Combined with the fact that calling `garbage-collect' between benchmarks
makes the benchmark time nearly constant, this result may or may not
mean something.

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