Subject: Re: bug#56393: Actually fix the long lines display bug

From: Eli Zaretskii <[email-masked]>
Date: Wed, 06 Jul 2022 16:32:23 +0300

> Date: Wed, 06 Jul 2022 13:06:26 +0000
> From: Gregory Heytings <[email-masked]>
> cc: [email-masked], [email-masked], [email-masked]
> 
> > One problem I spotted with the current branch is that it's still 
> > sluggish when commands are repeated very fast.  For example, visit the 
> > long-line.xml file, then lean on C-n or <DOWN> arrow -- you will see 
> > that this gets back to the very slow responses after traversing several 
> > lines.  By contrast, pressing C-n one keystroke at a time, even if I do 
> > that as fast as I can (say, 5 keypresses per second) performs much 
> > faster.
> 
> I don't see that.  On my seven year old laptop, Emacs remains responsive, 
> and commands are executed instantaneously.  Did you try M-x 
> find-file-literally?  If you don't see the slowdown with M-x 
> find-file-literally, it's a slowdown due to the major mode (in this case 
> nXML).

I see the same if I visit literally, just after leaning on C-n
longer.  It starts happening around 15% into the file.

And I don't think I understand what the major mode has to do with
this.  How do you think a major mode can affect C-n when font-lock is
turned off?

Here's the profile of leaning on C-n, in case it's useful:

        1082  94% - command-execute
        1082  94%  - call-interactively
        1077  93%   - funcall-interactively
        1076  93%    - next-line
        1076  93%     - line-move
         418  36%      - line-move-partial
           3   0%       - pos-visible-in-window-p
           2   0%        - eval
           2   0%           if
           1   0%          file-remote-p
           2   0%       + window-screen-lines
           2   0%       + default-line-height
           1   0%         posn-at-point
           1   0%       - window-inside-pixel-edges
           1   0%        + window-edges
         265  23%        line-move-visual
           1   0%    + execute-extended-command
           5   0%   + byte-code
          64   5% + ...
           1   0% + undo-auto--add-boundary