GNU bug report logs - #58558
29.0.50; re-search-forward is slow in some buffers

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 16 Oct 2022 01:27:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #125 received at 58558 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 58558 <at> debbugs.gnu.org, larsi <at> gnus.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#58558: 29.0.50; re-search-forward is slow in some buffers
Date: Wed, 14 Dec 2022 15:32:58 +0200
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: larsi <at> gnus.org, monnier <at> iro.umontreal.ca, 58558 <at> debbugs.gnu.org
> Date: Wed, 14 Dec 2022 13:23:02 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I think I'm confused now: what do you mean by "executing the
> > benchmark"?  I thought the problem was that each "execution of the
> > benchmark" was slower than the one before it, in which case markers
> > added between benchmarks _are_ relevant.  But you say they aren't?
> > What did I miss?
> 
> Increasing time of running benchmarks is just a symptom.
> The real issue I am experiencing is that re-search-forward becomes
> slower as I keep using Emacs. `garbage-collect' helps, but not in a long
> term.
> 
> Basically, running
> 
> M-: (benchmark-progn (goto-char (point-min)) (while (re-search-forward yant/re nil t)))
> 
> - right after starting Emacs is taking 3-4 seconds.
> - after several hours -- 10-20 seconds
> - in Emacs 28, <1 sec.
> 
> Markers may or may not be a problem.

What else could slow down buf_bytepos_to_charpos so much?  All it does
is examine markers.

> f they are, it is not necessarily related to markers created when I
> run the benchmarks. May also be some markers created during the
> Emacs session.

Which means massive creation of markers could be the reason,
regardless of what causes such massive creation.  Right?  But if so,
why did you say that markers created by some timer(s) were not
relevant?

Btw, did you try to compare the number of buffer markers in Emacs 28
and Emacs 29/30, under this scenario, when the search becomes slow
enough?




This bug report was last modified 2 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.