From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#15555: 24.3; Bidirectional display very slow with long lines Date: Tue, 08 Oct 2013 09:42:53 +0300 Message-ID: <83wqlo461e.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1381214662 20063 80.91.229.3 (8 Oct 2013 06:44:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 06:44:22 +0000 (UTC) Cc: 15555@debbugs.gnu.org To: Jerome L Quinn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 08 08:44:24 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VTR1r-00028S-M4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 08:44:23 +0200 Original-Received: from localhost ([::1]:34887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTR1r-0005I6-Ac for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 02:44:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTR1i-0005Hm-Cl for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 02:44:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTR1X-0002Du-Q1 for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 02:44:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTR1X-0002Do-MT for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 02:44:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VTR1X-0002cw-02 for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 02:44:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Oct 2013 06:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15555 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15555-submit@debbugs.gnu.org id=B15555.138121458410023 (code B ref 15555); Tue, 08 Oct 2013 06:44:01 +0000 Original-Received: (at 15555) by debbugs.gnu.org; 8 Oct 2013 06:43:04 +0000 Original-Received: from localhost ([127.0.0.1]:33764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTR0Y-0002ba-Ls for submit@debbugs.gnu.org; Tue, 08 Oct 2013 02:43:03 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:53838) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTR0V-0002b6-D4 for 15555@debbugs.gnu.org; Tue, 08 Oct 2013 02:43:01 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MUC005007TJOX00@a-mtaout20.012.net.il> for 15555@debbugs.gnu.org; Tue, 08 Oct 2013 09:42:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MUC005IK7ZJDG80@a-mtaout20.012.net.il>; Tue, 08 Oct 2013 09:42:55 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:79021 Archived-At: > From: Jerome L Quinn > Date: Mon, 7 Oct 2013 16:05:42 -0400 > > If I have a buffer with a very long line (14000 chars) with a mix of > ASCII and Arabic text, emacs gets painfully slow when point is further > along the line. Emacs is in general painfully slow with such long lines, even if there are only ASCII characters there. Presence of Arabic characters makes it slower, but it is unbearably slow even before that. This is a known deficiency of the Emacs display engine. This is bug #13675. > It looks like there's an N^2 algorithm dependent on the column of > point. No, there are no N² algorithms. However, for many display operations, Emacs needs to go to the beginning of the previous _physical_ line, and then go forward to the place it needs to redisplay. With very long lines, this takes a lot of time. If your data files don't include empty lines, there's perhaps another source of slowdown, which _is_ peculiar to bidirectional display: Emacs needs to find the beginning of the current paragraph to determine its "base direction". To see if this is your problem, try setting bidi-paragraph-direction to either left-to-right or right-to-left, depending on whether most of the text should be read left to right or right to left. > We encounter this kind of data in our work looking at generated > files. The only solution at the moment is to disable bidirectional > reordering. With 14 thousand characters per line, Emacs is slow even without reordering. Again, this is an existing bug. Disabling reordering is probably not a very good thing when you work with Arabic text. > There are also problems with the display. If you search for the following: > > 74,346,347 > > my display looks like: > > ... ,[["74,346,347],".",".","","."], ... > > Whereas it should display: > > ... ,[".","",".",".",[74,346,347]]]], ... > > Note that the first " is misplaced, even if you accept that the rest > should be reversed. This is what the Unicode Bidirectional Algorithm mandates, since " is a "weak" character, i.e. it gets its directionality from the surrounding text, and because your paragraph has the left-to-right base direction (because it begins with strong L2R character). Perhaps you should set bidi-paragraph-direction to right-to-left, as your text is predominantly Arabic. So I see no bug here wrt the display order. As for slow redisplay with very long lines, that is an existing bug report.