From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: CHAR_TO_BYTE in bidi_resolve_explicit_1 Date: Tue, 05 Mar 2013 05:51:33 +0200 Message-ID: <83vc96sdve.fsf@gnu.org> References: <513552F8.40405@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1362455565 14137 80.91.229.3 (5 Mar 2013 03:52:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 03:52:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 05 04:53:07 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCiw6-0004M2-AM for ged-emacs-devel@m.gmane.org; Tue, 05 Mar 2013 04:53:06 +0100 Original-Received: from localhost ([::1]:46058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCivk-0000od-Ti for ged-emacs-devel@m.gmane.org; Mon, 04 Mar 2013 22:52:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCivh-0000oX-L5 for emacs-devel@gnu.org; Mon, 04 Mar 2013 22:52:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCivg-00010Q-Oj for emacs-devel@gnu.org; Mon, 04 Mar 2013 22:52:41 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:43980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCivg-000108-GM for emacs-devel@gnu.org; Mon, 04 Mar 2013 22:52:40 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MJ60050050BBC00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Tue, 05 Mar 2013 05:51:38 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MJ60055Y5E21PA0@a-mtaout22.012.net.il>; Tue, 05 Mar 2013 05:51:38 +0200 (IST) In-reply-to: <513552F8.40405@yandex.ru> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157521 Archived-At: > Date: Tue, 05 Mar 2013 06:05:44 +0400 > From: Dmitry Antipov > CC: Emacs development discussions > > I suspect that this call to CHAR_TO_BYTE in bidi_resolve_explicit_1 > is redundant; can you check that? We could use BEGV_BYTE when we limit charpos to BEGV, yes. But otherwise, the call to CHAR_TO_BYTE is not redundant, because nothing else makes sure bidi_it->charpos is synchronized with bidi_it->bytepos when the display engine re-seats the display iterator. Did you see some evidence that the call to CHAR_TO_BYTE is redundant in the general case? The case of before BEGV is quite rare, so eliminating CHAR_TO_BYTE there won't give you any speed up, and CHAR_TO_BYTE is fast at BEGV anyway.