From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Case mapping of sharp s Date: Thu, 19 Nov 2009 21:11:15 -0500 Message-ID: References: <4B05A11F.5000700@gmx.de> <4B05D3EE.2000101@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258683116 25713 80.91.229.12 (20 Nov 2009 02:11:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2009 02:11:56 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org To: grischka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 20 03:11:48 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBIyO-0005fl-E9 for ged-emacs-devel@m.gmane.org; Fri, 20 Nov 2009 03:11:44 +0100 Original-Received: from localhost ([127.0.0.1]:38975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBIyN-0001uI-U7 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 21:11:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBIy1-0001kZ-Tt for emacs-devel@gnu.org; Thu, 19 Nov 2009 21:11:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBIxx-0001iV-0m for emacs-devel@gnu.org; Thu, 19 Nov 2009 21:11:21 -0500 Original-Received: from [199.232.76.173] (port=36791 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBIxw-0001iC-Pl for emacs-devel@gnu.org; Thu, 19 Nov 2009 21:11:16 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:50324 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBIxw-0001Lb-Fc for emacs-devel@gnu.org; Thu, 19 Nov 2009 21:11:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAACKBUvO+IIa/2dsb2JhbACBTtRThDsEiW8 X-IronPort-AV: E=Sophos;i="4.44,774,1249272000"; d="scan'208";a="49711115" Original-Received: from 206-248-130-26.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.26]) by ironport2-out.pppoe.ca with ESMTP; 19 Nov 2009 21:11:15 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 458A989A7; Thu, 19 Nov 2009 21:11:15 -0500 (EST) In-Reply-To: <4B05D3EE.2000101@gmx.de> (grischka's message of "Fri, 20 Nov 2009 00:25:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117315 Archived-At: > Also how can it happen that a C function varies between 4 and 90 > seconds for the same action. I have no explanation for that. >> As for the general slowdown, it may also be due to having to parse the >> char (encoded in utf-8) and then look it up in the corresponding char table >> (a tree of arrays). > From what I saw the simple_search() calls out to lisp for every > single buffer-byte I really don't think that's the case. > whereas boyer_moore() just translates it with a prefabricated C table. > However if simple_search just would prepare the first char of > the pattern in both lower and uppercase version readily for > comparison it could be as fast as bm I guess (for a pattern > length of less than 4 that is) There may be more than 2 chars in the same "case-fold" equivalence class, so it may be a bit more difficult in general, but you're probably right that it can be made faster. Stefan