Subject: bug#9470: 24.0.50; Possible bidi-related slowness

From: Stefan Monnier <[email-masked]>
Date: Sat, 10 Sep 2011 23:06:06 -0400

>> > The question is, what is "exciting", and what should we do when we
>> > "bail out"?
>> I defer to you what would be exciting.  :-)  I would have thought the
>> presence of no strongly R2L characters would be a measure of
>> non-excitingness...
> The long search is for the paragraph beginning.  Looking for R2L
> characters during that search will slow it even more.
> Anyway, I reopened the bug and will try to think of something.

I think Lars's point is a good one: maybe the paragraph direction can be
based on the predominance of L2R or R2L chars in the previous N chars,
in case the paragraph beginning is further than that (N should be large
enough to include all chars displayed).

Otherwise, I think the only way to make it faster is by caching the
result of the computation (I suspect you already do some caching, but
maybe we just need to be more aggressive).

        Stefan