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

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

Re: Performance of `re-search-backward' vs `re-search-forward'


From: Marcin Borkowski
Subject: Re: Performance of `re-search-backward' vs `re-search-forward'
Date: Mon, 12 Apr 2021 21:39:54 +0200
User-agent: mu4e 1.1.0; emacs 28.0.50

On 2021-04-12, at 17:13, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> I seem to (very vaguely) remember reading that `re-search-backward' is
>> significantly slower than `re-search-forward'.  However, I can't find
>> anything about it in the docstring (nor in the Elisp reference) now.  Am
>> I even correct?
>
> I haven't looked at the code recently so my memory might be off, but
> I can't think of any reason why it should be noticeably slower, no.

So both basically move character by character and check if the regex
matches there (more or less)?

> Maybe you're confusing it with `looking-back` which is much slower than
> `looking-at`?

Yes, that was it!  Thanks!

Best,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

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