Subject: Re: bug#30457: 26.0.91; bidi-display-reordering makes navigation around melpa/archive-contents slow

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 Feb 2018 20:40:10 +0200

> From: Aaron Jensen <[email-masked]>
> Date: Wed, 14 Feb 2018 08:49:58 -0800
> 
> In this thread, Eli asked for a real world repro where
> bidi-display-reordering slows down emacs:
> https://www.reddit.com/r/emacs/comments/7wezb4/how_can_i_make_line_rendering_faster/
> 
> I found that today, so I wanted to report it.
> 
> Download: https://melpa.org/packages/archive-contents
> 
> emacs -Q archive-contents
> 
> Press and hold C-n (I have a very fast key repeat rate)
> 
> On my machine, it takes about 13 seconds to get to the bottom of the
> window (where it first scrolls, not the bottom of the buffer, I don't
> have the patience for that).
> 
> (setq bidi-display-reordering nil)
> 
> Press and hold C-n
> 
> On my machine, it takes about 1 second to get to the bottom of the
> window.

It's a 870K line with multi-level parentheses.  As already mentioned
there, the BPA implementation that is part of the bidi reordering
makes this sluggish due to the many parentheses in such a long line.
(However, it's nowhere near 13 sec on my box.  And going several lines
in one go, as in "C-u 20 C-n", makes it even faster.)

> I hope that this is a compelling enough use-case. I don't believe I have
> a use-case for it to be `t` right now, so I'll be setting it to `nil` by
> default in my config

Beware: the code which is used when bidi-display-reordering is nil is
unsupported since Emacs 24, so you are on your own when using it.  I
urge you to reconsider.