From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#9470: 24.0.50; Possible bidi-related slowness Date: Mon, 12 Sep 2011 22:21:54 -0400 Message-ID: References: <83mxecxhl1.fsf@gnu.org> <83k49gxgol.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315880570 7431 80.91.229.12 (13 Sep 2011 02:22:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 02:22:50 +0000 (UTC) Cc: 9470@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 13 04:22:46 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3Ie2-0003DA-0j for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Sep 2011 04:22:42 +0200 Original-Received: from localhost ([::1]:41309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Ie1-0008JI-JV for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Sep 2011 22:22:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Idz-0008Iz-5o for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 22:22:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3Idy-0007Mh-0g for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 22:22:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Idx-0007Mb-Sy for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 22:22:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R3IiE-0007Ow-4q; Mon, 12 Sep 2011 22:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Sep 2011 02:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9470-submit@debbugs.gnu.org id=B9470.131588078328402 (code B ref 9470); Tue, 13 Sep 2011 02:27:02 +0000 Original-Received: (at 9470) by debbugs.gnu.org; 13 Sep 2011 02:26:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3Iha-0007O3-Lt for submit@debbugs.gnu.org; Mon, 12 Sep 2011 22:26:22 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3IhY-0007Nv-Ht for 9470@debbugs.gnu.org; Mon, 12 Sep 2011 22:26:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAJi9bk5FxK3+/2dsb2JhbABCp295gVIBAQQBViMFCws0EhQYDSSICrdhhm4EoDOEQw X-IronPort-AV: E=Sophos;i="4.68,371,1312171200"; d="scan'208";a="135968629" Original-Received: from 69-196-173-254.dsl.teksavvy.com (HELO ceviche.home) ([69.196.173.254]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 12 Sep 2011 22:21:54 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 82D8C660B6; Mon, 12 Sep 2011 22:21:54 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Mon, 12 Sep 2011 03:21:45 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 12 Sep 2011 22:27:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51082 Archived-At: >> I do assume we have some way to flush the cache (or parts thereof) >> that become invalid, tho. > If we add the necessary code to prepare_to_modify_buffer, yes. That > code will need to either update the START and END positions or > invalidate the cache, depending on what modification is about to > happen. But not if the change is to add or remove text properties. We don't have to pay attention to text properties, but I guess you're right that the cache can surprive changes to text-properties. > We will also need to invalidate the cache whenever the iterator > position winds up outside the (START..END) region, and update it as we > cross paragraph boundaries during iteration. I don't see why, in general (you'd just flush the cache when a request comes in for a different paragraph, i.e. to make room for another piece of data), but in either case I don't think it would make much of a difference, since the main use case if for a very long paragraph which presumably covers the whole window. >> > Any of these edits could insert or delete a paragraph boundary, and >> > thus potentially change the paragraph direction. >> Sure. But if there aren't any edits, the cache is still valid. > If there are no edits _and_ point didn't move before START or far > after END. Right: movement within a paragraph. If there are edits nearby, you can still re-scan from the edits, so it's still fast. > Having the first command take 5 seconds is still going to annoy. We Yes. Improvement to the worst case is better. Stefan