From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69385: 30.0.50; Long lines with bidi text slow down Emacs Date: Thu, 07 Mar 2024 13:25:03 +0200 Message-ID: <8634t22sj4.fsf@gnu.org> References: <878r381pjk.fsf@gmx.net> <86msrowk0g.fsf@gnu.org> <87zfvozaj7.fsf@gmx.net> <86edd0wdbs.fsf@gnu.org> <87r0h0z3fl.fsf@gmx.net> <868r37wgkx.fsf@gnu.org> <87zfvnfh4d.fsf@gmx.net> <86v86bux3w.fsf@gnu.org> <86ttlvuwxo.fsf@gnu.org> <87r0gzfe5a.fsf@gmx.net> <86r0gzusrx.fsf@gnu.org> <87msrnfc7h.fsf@gmx.net> <86o7c3uqqt.fsf@gnu.org> <87il2bf8uz.fsf@gmx.net> <86bk83uj9a.fsf@gnu.org> <86edcrny2g.fsf@gnu.org> <87sf16azxp.fsf@gmx.net> <86cysam50x.fsf@gnu.org> <871q8m8fd8.fsf@gmx.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14551"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69385@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 07 12:26:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1riBtJ-0003YP-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Mar 2024 12:26:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riBss-0004RP-FC; Thu, 07 Mar 2024 06:26:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riBsV-0004Fy-CP for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 06:25:42 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1riBsR-0000AD-Gj for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 06:25:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riBsv-000545-MO for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2024 06:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2024 11:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69385 X-GNU-PR-Package: emacs Original-Received: via spool by 69385-submit@debbugs.gnu.org id=B69385.170981075219441 (code B ref 69385); Thu, 07 Mar 2024 11:26:01 +0000 Original-Received: (at 69385) by debbugs.gnu.org; 7 Mar 2024 11:25:52 +0000 Original-Received: from localhost ([127.0.0.1]:52673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riBsm-00053V-94 for submit@debbugs.gnu.org; Thu, 07 Mar 2024 06:25:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riBsj-00053B-KB for 69385@debbugs.gnu.org; Thu, 07 Mar 2024 06:25:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riBs5-0008ET-FO; Thu, 07 Mar 2024 06:25:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=o7LKYwMPbBW9BGaUgFxF2975oEc8/pjNwx7iSrFg3dA=; b=aCr9lw/7LBcN gpM6+z5625b46dweqppKD9TOF6SjcugE96wtPOYF0mfi06nn2TNgluDrEOTpGXfNUvNVkSc1XpJjT aGSoFNunLupCnaODIm0+I4rxHQILCy1/puoaFI+tx5lQTQt9FTubfgP1TJxNKL38sskLk4SvkDKX3 R7Jev0V5KmVFTw1OxjkdgaHKSMfHXVdnGZSEuAOV6XCCytKwArNkUy35zLbq6PiPFtcu7nWYfJJEv ms91FwZTqxfCWldM3jhjpeoKzaowUwVYLGeKfzsVdCXliaxecENOzHNNrLhBrwt063KFRGrcQ/1zT 5vAKh4IQPtW/ZTHJmTz2Ag==; In-Reply-To: <871q8m8fd8.fsf@gmx.net> (message from Stephen Berman on Thu, 07 Mar 2024 12:12:51 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281162 Archived-At: > From: Stephen Berman > Cc: 69385@debbugs.gnu.org > Date: Thu, 07 Mar 2024 12:12:51 +0100 > > Most of the Arabic words in the problematic file are enclosed in the > bidirectional control characters POP DIRECTIONAL FORMATTING (#x202c) and > RIGHT-TO-LEFT EMBEDDING (#x202b). I did not add these characters, but I > had copy-&-pasted most of the Arabic from a PDF file I did not create. > I don't know if PDFs of Arabic text normally contain these control > characters, but the consequences for Emacs were dramatic. When I simply > visited this file in Emacs (started with -Q) there was an immediate > slowdown, and in top I could see Emacs using 100% of a CPU thread. When > I ran the end-of-buffer benchmark on this file, the result (with your > patch) was: > > (27.962602113 2 0.0226042269999999977) > > However, the display of that result only appeared in the echo area after > more than a minute (I timed it with a stopwatch). At that point the > mode line showed the buffer at 4% from the top, and the display remained > frozen afterwards. After several minutes during which Emacs consumed > 100% CPU, and I had switched the focus away from the Emacs frame, the > CPU consumption stopped, but as soon as I switch focus back to that > frame, it went back to 100%. The display never changed from showing the > buffer at 4%, apparently being in some kind of infinite loop. After > about 15 minutes I started gdb, attached the Emacs process and produced > a backtrace, which I've attached, in the hope it helps to diagnose the > problem. > > The problem seems to be certainly related the the bidirectional control > characters, because I made a copy of the file and removed all > occurrences of these control characters from it, and then ran the > end-of-buffer benchmark, getting this result (with your patch): > > (0.716104165 4 0.04223660400000001) > > And the display updated normally and CPU consumption was normal. > > Nevertheless, there seems to be something else besides the control > characters involved in this issue, because as a futher test, I created a > buffer consisting of more than 1000 copies of the test string > concatenating the Arabic example in etc/HELLO and "Hello", and manually > enclosed each Arabic word in the above control characters, but the > benchmark result in this buffer was not significantly different from the > result without the control characters (and similar to the above result > for the copy of the problematic file without the control characters), > and the display did not freeze. Please submit a separate bug report, and please post an example of a problematic file with the report. Thanks.