unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Gerald Wildgruber <wildgruber@tu-berlin.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acm@muc.de, emacs-devel@gnu.org
Subject: Re: follow-mode: extremely slow in combination with org-mode
Date: Tue, 19 Jun 2018 15:53:55 +0200	[thread overview]
Message-ID: <87efh2naq4.fsf@tu-berlin.de> (raw)
In-Reply-To: <83d0wptpmu.fsf@gnu.org>

Hi

I tried the patched follow.el (the one that contains the modified
follow-calc-win-end) on my somewhat slower (but also new quad core)
office machine, unfortunately no amelioration of lag was noticeable.

Same procedure: patching follow.el, starting the profiler, loading the
patched uncompiled version into emacs via M-x load-file and finally
start editing.

The lag remains enormous (e.g. more than a second lag between typing RET
and seeing a newline on screen); I noticed however, that upon typing RET
one time, the newline comes almost immediately; but after typing more
RETs they take ages to appear on screen.

Bizarrely, this happened also: redisplay takes very long and it
apparently aborts leaving paragraphs before point unfilled, one long
line of text (I always use auto-fill-mode).

On So, Jun 17 2018, Eli Zaretskii <eliz@gnu.org> wrote:

> Each character you insert triggers redisplay, and I'm guessing
> follow-mode has many of the redisplay optimizations disabled.

Actually, I had no idea. I tried to understand what "redisplay" is (by
reading the comments at the beginning of emacs/src/xdisp.c) and the more
I read, the less I am surprised it takes so long! :-)

Why might those optimizations have been disabled on follow-mode?

> But it may be interesting to see a profile when all you do is type
> self-inserting characters, maybe we will learn something important
> from that.

Here is another profile, now on my office machine with only
self-inserting commands, i.e. typing just "normal" letters:

- follow-post-command-hook                                      54982  61%
 - if                                                           54982  61%
  - let                                                         54975  61%
   - save-current-buffer                                        54975  61%
    - follow-adjust-window                                      54975  61%
     - if                                                       54972  61%
      - progn                                                   54972  61%
       - let                                                    53646  59%
        - let*                                                  53646  59%
         - if                                                   53646  59%
          - follow-redisplay                                    49062  54%
           - let*                                               49062  54%
            - cond                                              43568  48%
             - follow-calculate-first-window-start-from-above              43568  48%
              - save-excursion                                  43568  48%
               - let                                            43568  48%
                - while                                         43564  48%
                 - if                                           43564  48%
                  - setq                                        42813  47%
                   - follow-calc-win-start                      42813  47%
                    - while                                     42813  47%
                     - let                                      42802  47%
                      - setq                                    42789  47%
                       - car                                    42789  47%
                        - follow-calc-win-end                   42785  47%
                         - let                                  42785  47%
                          - save-current-buffer                 42785  47%
                           - unwind-protect                     42785  47%
                            - progn                             42777  47%
                             - let*                             42767  47%
                              + setq                               10   0%
                              + window-end                          4   0%
                     + and                                          7   0%
                  + not                                           747   0%
                    if                                              4   0%
            + follow-calc-win-start                              3062   3%
            + follow-estimate-first-window-start                 1410   1%
            + let                                                1022   1%
          - let                                                  4574   5%
           - redisplay                                           4570   5%
            - redisplay_internal (C function)                      17   0%
             - eval                                                11   0%
                if                                                  8   0%
                mode-line-eol-desc                                  3   0%
          + follow-avoid-tail-recenter                              7   0%
            if                                                      3   0%
       + follow-windows-start-end                                1326   1%
     + progn                                                        3   0%
  + follow-post-command-hook                                        3   0%
+ command-execute                                               27012  30%


Anything else to try to get a faster follow-mode?

Thanks

Gerald.


---------------------
Sent with mu4e



  parent reply	other threads:[~2018-06-19 13:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-16 10:25 follow-mode: extremely slow in combination with org-mode Gerald Wildgruber
2018-06-16 11:41 ` Eli Zaretskii
2018-06-16 13:06   ` Gerald Wildgruber
2018-06-16 16:25     ` Eli Zaretskii
2018-06-16 21:05       ` Gerald Wildgruber
2018-06-17  6:57       ` Gerald Wildgruber
2018-06-17  8:12         ` Eli Zaretskii
2018-06-17 11:13           ` Alan Mackenzie
2018-06-17 13:02             ` Eli Zaretskii
2018-06-17 14:56               ` Gerald Wildgruber
2018-06-17 15:10                 ` Eli Zaretskii
2018-06-19 12:08                   ` Gerald Wildgruber
2018-06-19 16:55                     ` Eli Zaretskii
2018-06-19 13:53                   ` Gerald Wildgruber [this message]
2018-06-17 15:13             ` Eli Zaretskii
2018-06-21  8:25 ` Anders Lindgren
2018-06-27 16:43   ` Gerald Wildgruber
2018-07-09 20:12     ` Anders Lindgren

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=87efh2naq4.fsf@tu-berlin.de \
    --to=wildgruber@tu-berlin.de \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).