GNU bug report logs - #62780
30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 11 Apr 2023 18:51:02 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62780 <at> debbugs.gnu.org
Subject: bug#62780: 30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace
Date: Tue, 11 Apr 2023 19:41:01 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

> show-trailing-whitespace disables quite a few redisplay optimizations,
> including even the cursor-motion optimization (when nothing has
> changed on display except the position of point).  And full thorough
> redisplay becomes slow when you have relatively long lines, because
> Emacs is forced to consider all of them.

Well. But it is not even that big of a file. And the lines are shorter
than window width.

I could understand Emacs lagging on some really large file or long
lines, but this does not look large at all!

> In addition, org-table seems to put a large number of 'display'
> properties (like, 2 per cell?), which also slows down redisplay.

These properties are for the purpose of bidirectional ordering:

(defconst org-table--separator-space-pre
  (propertize " " 'display '(space :relative-width 1))
  "Space used in front of fields when aligning the table.
This space serves as a segment separator for the purposes of the
bidirectional reordering.
Note that `org-table--separator-space-pre' is not `eq' to
`org-table--separator-space-post'.  This is done to prevent Emacs from
visually merging spaces in an empty table cell.  See bug#45915.")

Maybe there is a better way?

> Are you saying there's been a regression in Emacs 30 in this situation
> wrt Emacs 29 and Emacs 28?  I don't think I see a regression in my
> testing here.

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?

-- 
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>




This bug report was last modified 2 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.