bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ihor Radchenko
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@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>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]