From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Case mapping of sharp s Date: Thu, 19 Nov 2009 23:43:19 +0100 Organization: Organization?!? Message-ID: <87iqd6gmpk.fsf@lola.goethe.zz> References: <4B05A11F.5000700@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258670646 23813 80.91.229.12 (19 Nov 2009 22:44:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 22:44:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 23:43:59 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 1NBFjL-0002Vv-44 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 23:43:59 +0100 Original-Received: from localhost ([127.0.0.1]:58652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBFjK-0006uT-Lu for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 17:43:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBFjD-0006ts-09 for emacs-devel@gnu.org; Thu, 19 Nov 2009 17:43:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBFj8-0006sK-Ao for emacs-devel@gnu.org; Thu, 19 Nov 2009 17:43:50 -0500 Original-Received: from [199.232.76.173] (port=50712 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBFj8-0006sH-6o for emacs-devel@gnu.org; Thu, 19 Nov 2009 17:43:46 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:40523) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBFj7-0002sn-IY for emacs-devel@gnu.org; Thu, 19 Nov 2009 17:43:45 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NBFj5-0002Ow-N9 for emacs-devel@gnu.org; Thu, 19 Nov 2009 23:43:43 +0100 Original-Received: from p5b2c20b9.dip.t-dialin.net ([91.44.32.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Nov 2009 23:43:43 +0100 Original-Received: from dak by p5b2c20b9.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Nov 2009 23:43:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c20b9.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:VVErytrzVoG3XzHCbAW9nevCZ8g= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:117308 Archived-At: Stefan Monnier writes: >> Actually I think there is something simply wrong with the simple >> search, as it's much slower even for single chars (where bm doesn't >> have any advantage) and additionally in some weird random fashion >> it's again slower for backwards search, such as 14, 37, 66 ... 94 >> secs, where the bm takes 0.5 secs and simple forward constantly >> ~3.7 secs, all for isearch'ing one character in a 100Mb file. > > I can guess why it's much slower going backward: the simple search > operates on chars rather than bytes. The internal encoding we use > (currently based on utf-8) is designed to be easy to parse going forward > but not so easy going backward (IIRC our encoding is actually even a bit > more painful in this case than pure utf-8). I don't think so. The utf-8 _scheme_ can be used to encode 21bits in 4 characters. We stay within that range, in the utf-8 4 character scheme, but outside of the Unicode range 2^20+2^16. > BM on the other hand works on bytes, so there's no such slowdown. With utf-8, I think that apart from character ranges, search forward and backward should work perfectly like on 8-bit characters. Exception is incomplete character matches, but since the utf-8 scheme can immediately tell "is a 7-bit character" "is the first character of a multibyte sequence of length n" "is last or intermediate character of multibyte sequence" this is not a serious problem. > But maybe we're doing something silly somewhere. The Emacs 22 multibyte scheme likely had worse properties for reverse searching. So maybe something might be simplified nowadays. -- David Kastrup