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: Fri, 14 Apr 2023 11:36:09 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I cannot reproduce.
>> The typing has no noticeable delays.
>
> Your build is optimized, yes?  Try building without optimizations, you
> will see quite significant delays just by creating the table.

Sure, but there is no obvious culprit then:

     4.01%  emacs         emacs                       [.] lookup_char_property
     3.04%  emacs         emacs                       [.] make_lisp_symbol
     3.01%  emacs         emacs                       [.] find_interval
     2.85%  emacs         emacs                       [.] next_interval
     2.37%  emacs         emacs                       [.] XSYMBOL
     2.27%  emacs         emacs                       [.] SYMBOLP
     2.16%  emacs         emacs                       [.] make_lisp_symbol
     2.06%  emacs         emacs                       [.] make_lisp_symbol

Various functions contribute almost equally with relatively larger (yet,
just 4%) contribution from lookup_char_property called from face_at_pos
(according to the call graph).

I looked into the number of calls to face_at_pos, find_composition, and
handle_display_prop. The number of calls is almost the same. Thus, my
guess is that find_composition is somehow slower than the other two
functions.

Looking int the code, I can see that handle_display_prop does not call
Fnext_single_property_change at all and face_at_pos limits the forward
lookup by TEXT_PROP_DISTANCE_LIMIT. In contrast, compute_stop_pos calls
composition_compute_stop_pos without making use of
TEXT_PROP_DISTANCE_LIMIT (AFAIU) and looks all the way to point-max. (Do
I understand correctly that it implies O(N_intervals^2)??)

> In any case, if you think disabling static composition can be a
> reasonable option for Org Table users (do they use
> prettify-symbols-mode, for example, in the same buffer where they have
> Org tables?), that should be easy.

I'd still prefer to find a better way and leave this workaround as the
last resort.

-- 
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 47 days ago.

Previous Next


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