From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: Re: skip-chars-forward v. re-search-forward Date: Thu, 1 May 2003 16:11:00 +0900 (JST) Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200305010711.QAA14948@etlken.m17n.org> References: <200304240141.KAA05156@etlken.m17n.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1051773042 30210 80.91.224.249 (1 May 2003 07:10:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 1 May 2003 07:10:42 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 01 09:10:39 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19B8D4-0007qq-00 for ; Thu, 01 May 2003 09:10:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B8Do-0007id-04 for gnu-bug-gnu-emacs@m.gmane.org; Thu, 01 May 2003 03:11:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19B8Dg-0007hk-00 for bug-gnu-emacs@gnu.org; Thu, 01 May 2003 03:11:04 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19B8Df-0007hZ-00 for bug-gnu-emacs@gnu.org; Thu, 01 May 2003 03:11:03 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B8De-0007hS-00; Thu, 01 May 2003 03:11:02 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h417B1o29521; Thu, 1 May 2003 16:11:01 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h417B0A05431; Thu, 1 May 2003 16:11:00 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id QAA14948; Thu, 1 May 2003 16:11:00 +0900 (JST) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Fri, 25 Apr 2003 22:33:02 -0400) 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) Original-cc: d.love@dl.ac.uk X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4926 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4926 In article , Richard Stallman 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