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


Message #44 received at 62780 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 62780 <at> debbugs.gnu.org
Subject: Re: bug#62780: 30.0.50; Redisplay gets slow when using Org tables +
 show-trailing-whitespace
Date: Fri, 14 Apr 2023 15:06:17 +0300
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 62780 <at> debbugs.gnu.org
> 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:

The culprit is the humongous number of calls to handle_stop, I think.

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

OK, I have an idea: I think the fact that compute_stop_pos calls
find_composition (via composition_compute_stop_pos) is a mistake,
because the 'composition' text property is found by the previous code
in compute_stop_pos, exactly like we find 'display' and 'fontified'.
So compute_stop_pos has no reason to call find_composition.

But to test this idea, I need enough test cases that use the
'composition' property to make sure the property still works after I
disable that call.  Can you collect a few test cases which use the
'composition' property, with or without Org tables?  I guess
prettify-symbols-mode is one of them, but are there others?  I will
then try to find time to test this idea.




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.