Subject: bug#62780: 30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace

From: Ihor Radchenko <[email-masked]>
Date: Wed, 12 Apr 2023 07:39:37 +0000

Eli Zaretskii <[email-masked]> writes:

>> Maybe there is a better way?
>
> Maybe.  Can you point me to the discussion which caused you to use
> these display properties there?  I think this was done in two steps:
> first you added the same display property as pre and post, then made
> them subtly different; I need to re-read the discussions that led to
> both of these.

The first step was in
https://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00526.html

Then, we had an issue with empty cells |<spc><spc>| with Emacs joining
two spaces with eq text properties.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45915

>> No, I do not mean a regression. But the slowdown appears to be
>> unreasonable for such a small test case. What is the point having
>> `show-trailing-whitespace' if it is this much inefficient? Maybe a
>> simple font-lock rule can be better?
>
> See above: show-trailing-whitespace is not the main culprit here;
> these particular display properties are.  If you could produce a perf
> profile with this recipe, it might give ideas for speeding up the C
> code without any changes on the Lisp level.

Ok. I will look into it. If we can speed this up, it will hopefully
benefit more than just this particular scenario.

> Btw, these properties were introduced into org-table.el some time ago,
> so how come this issue comes up only now?  Aren't Org tables used
> quite a lot?

I guess things are not that much obvious without show-trailing-whitespace.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>