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: Eli Zaretskii
Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers
Date: Sun, 16 Oct 2022 13:36:26 +0300

> Cc: 58558@debbugs.gnu.org
> From: Ihor Radchenko <yantar92@posteo.net>
> Date: Sun, 16 Oct 2022 10:02:25 +0000
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
> > If you switch the buffer to `clean-mode' (which should remove all text
> > props), does the slowdown disappear?  In that case, it seems likely that
> > the slowdown is connected to text properties, somehow.
> 
> The slowdown becomes slightly better, but nowhere close to Emacs 28:
> 
> ;; Emacs 29
> ;; Elapsed time: 16.953404s
> ;; Emacs 29 + clean-mode
> ;; Elapsed time: 13.290568s
> ;; Emacs 28
> ;; Elapsed time: 0.869748s
> 
> I did
> 
> (setq yant/re "\\(?:\\(?:\\<DEADLINE: 
> *\\(\\(?:<\\(?:[[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{2\\}\\(?: 
> [[:alpha:]]+\\)?\\)\\(?: 
> [[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\(?:-[[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\)?\\)?\\(?:\\(?:
>  
> [+.:-]\\{1,2\\}[[:digit:]]+[dhmwy]\\(?:/[[:digit:]]+[dhmwy]\\)?\\)\\{1,2\\}\\)?>\\)\\)\\)\\|\\(?:\\(?:<\\(?:[[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{2\\}\\(?:
>  [[:alpha:]]+\\)?\\)\\(?: 
> [[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\(?:-[[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\)?\\)?\\(?:\\(?:
>  
> [+.:-]\\{1,2\\}[[:digit:]]+[dhmwy]\\(?:/[[:digit:]]+[dhmwy]\\)?\\)\\{1,2\\}\\)?>\\)\\|^\\*+[[:blank:]]+\\(?:[[:upper:]]+[[:blank:]]+\\)?\\[#A]\\|^[[:space:]]*:STYLE:[[:space:]]+habit[[:space:]]*$\\)\\)")
> (benchmark-progn (goto-char (point-min)) (while (re-search-forward yant/re 
> nil t)))

AFAICT, the changes in regex-emacs.c between these two versions are
very minor, almost non-existent.  So it sounds like the reason is
somewhere else, not in regexp search per se.  But to be absolutely
sure, could you please try building Emacs 29 with regex-emacs.c from
Emacs 28, and see if the slowdown disappears or not?

Thanks.





reply via email to

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