Subject: Re: bug#69385: 30.0.50; Long lines with bidi text slow down Emacs

From: Stephen Berman <[email-masked]>
Date: Mon, 26 Feb 2024 16:17:38 +0100

On Mon, 26 Feb 2024 16:19:15 +0200 Eli Zaretskii <[email-masked]> wrote:

>> From: Stephen Berman <[email-masked]>
>> Cc: [email-masked]
>> Date: Mon, 26 Feb 2024 15:13:38 +0100
>>
>> On Mon, 26 Feb 2024 14:33:18 +0200 Eli Zaretskii <[email-masked]> wrote:
[...]
>> > If, after starting Emacs, you set all the entries of Arabic characters
>> > in composition-function-table to nil (e.g., using
>> > set-char-table-range), do you see significant speedup?
>>
>> Yes, there is a noticeable speedup when M-> and C-v, M-v, and even
>> holding down C-n and C-p is faster, though they still freeze after a few
>> seconds, but the freeze doesn't last as long as when it happens with the
>> shaped Arabic script.  Also, probably unsurprisingly, the speed after
>> disabling shaping is still much slower than keeping shaping enabled but
>> setting bidi-display-reordering to nil.
>
> Is this with text from HELLO, or with some other Arabic text?  The
> prominent effect of bidi-display-reordering is actually surprising,
> and not what I see here, with or without shaping.  Very strange.

All my tests in this thread have been with the Arabic example text in
HELLO, though the file with which I first noticed the slowdown contains
much more and different Arabic text, as well as ASCII and non-ASCII
characters without shaping.  Here, the speed difference, when executing
movement and other commands in a buffer with a long line of
bidirectional text containing shaped Arabic, between
bidi-display-reordering t and nil is like night and day.  If it's not
that way for you I can only assume it's due to another factor
distinguishing our systems that hasn't yet been identified.

Steve Berman