unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: 62780@debbugs.gnu.org
Subject: bug#62780: 30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace
Date: Fri, 14 Apr 2023 15:06:17 +0300	[thread overview]
Message-ID: <83pm86fz2e.fsf@gnu.org> (raw)
In-Reply-To: <87pm86n1au.fsf@localhost> (message from Ihor Radchenko on Fri, 14 Apr 2023 11:36:09 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: 62780@debbugs.gnu.org
> 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:

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.





  reply	other threads:[~2023-04-14 12:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 18:52 bug#62780: 30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace Ihor Radchenko
2023-04-11 19:25 ` Eli Zaretskii
2023-04-11 19:41   ` Ihor Radchenko
2023-04-12  7:19     ` Eli Zaretskii
2023-04-12  7:39       ` Ihor Radchenko
2023-04-12  7:58         ` Eli Zaretskii
2023-04-13  9:46       ` Ihor Radchenko
2023-04-13 10:45         ` Eli Zaretskii
2023-04-13 11:15           ` Ihor Radchenko
2023-04-13 14:33             ` Eli Zaretskii
2023-04-14  9:20               ` Ihor Radchenko
2023-04-14 10:37                 ` Eli Zaretskii
2023-04-14 11:36                   ` Ihor Radchenko
2023-04-14 12:06                     ` Eli Zaretskii [this message]
2023-04-14 12:23                       ` Eli Zaretskii
2023-04-14 12:52                         ` Ihor Radchenko
2023-04-14 13:51                           ` Eli Zaretskii
2023-04-14 13:56                             ` Ihor Radchenko
2023-04-14 14:47                               ` Eli Zaretskii
2023-04-14 14:56                                 ` Ihor Radchenko
2023-04-14 15:06                                   ` Eli Zaretskii
2023-04-14 15:23                                     ` Ihor Radchenko
2023-04-14 12:28                       ` Ihor Radchenko
2023-04-29  8:57                         ` Eli Zaretskii
2023-04-29 18:03                           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pm86fz2e.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62780@debbugs.gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).