Subject: bug#56682: Fix the long lines font locking related slowdowns

From: Eli Zaretskii <[email-masked]>
Date: Sat, 06 Aug 2022 17:05:21 +0300

> Date: Fri, 05 Aug 2022 11:50:56 +0000
> From: Gregory Heytings <[email-masked]>
> cc: [email-masked], [email-masked], [email-masked], 
>     [email-masked]
> 
> Indeed, that seems to be the culprit here, I didn't know that text-mode 
> was an exception here.  If I set bidi-paragraph-direction to 
> 'left-to-right after visiting the arabic-small.txt file, Emacs (mis) 
> behaves like it does for the other Arabic files: it becomes slow, and C-n 
> C-p do not work correctly anymore.

I've installed a change that makes Arabic rendering roughly twice
faster.  It is still quite slow, but less so.