[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: skip-chars-forward v. re-search-forward
From: |
Kenichi Handa |
Subject: |
Re: skip-chars-forward v. re-search-forward |
Date: |
Thu, 1 May 2003 16:11:00 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
In article <E199FUs-0003kd-00@fencepost.gnu.org>, Richard Stallman
<rms@gnu.org> writes:
> It's still surprising that search-forward/backward is more
> than twice faster. I have no idea what kind of magic the
> boyer-moore search is using.
> The comparison between search-forward and skip-chars-forward
> does not seem meaningful to me, because they do different jobs.
> The only case which both of these functions can do is
> (search-forward "a") and (skip-chars-forward "^a").
That is what I did in my benchmark test.
(search-forward "%")
vs (skip-chars-forward "^%")
vs (re-search-forward "[%]")
> The time taken by search-forward is inversely proportional to the
> search string size in favorable cases, so if you tried a longer
> string, it was probably faster.
Yes, I know that. I was surprised because search-forward
was twice faster even if the search string size is one.
---
Ken'ichi HANDA
handa@m17n.org
- Re: skip-chars-forward v. re-search-forward,
Kenichi Handa <=