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 #47 received at 62780 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 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:23:55 +0300
> Cc: 62780 <at> debbugs.gnu.org
> Date: Fri, 14 Apr 2023 15:06:17 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Ihor Radchenko <yantar92 <at> posteo.net>
> > Cc: 62780 <at> debbugs.gnu.org
> > Date: Fri, 14 Apr 2023 11:36:09 +0000
> > 
> > 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)??)

Btw, it is not true that we are looking all the way to point-max in
this case: you will see in composition_compute_stop_pos that it limits
the search to the next 500 buffer positions:

  void
  composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
				ptrdiff_t bytepos, ptrdiff_t endpos,
				Lisp_Object string)
  {
    ptrdiff_t start, end;
    int c;
    Lisp_Object prop, val;
    /* This is from forward_to_next_line_start in xdisp.c.  */
    const int MAX_NEWLINE_DISTANCE = 500;

    if (charpos < endpos)
      {
	if (endpos > charpos + MAX_NEWLINE_DISTANCE)
	  endpos = charpos + MAX_NEWLINE_DISTANCE;
      }
  [...]
    if (charpos < endpos
	&& find_composition (charpos, endpos, &start, &end, &prop, string)
	&& start >= charpos
	&& composition_valid_p (start, end, prop))




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.