unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Will Bush <will.g.bush@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
	Robert Pluim <rpluim@gmail.com>,
	40733@debbugs.gnu.org, James Cloos <cloos@jhcloos.com>
Subject: bug#40733: 28.0.50; Emacs locks up on paste (yank) of unicode characters
Date: Wed, 29 Apr 2020 06:59:42 -0500	[thread overview]
Message-ID: <CA+aYz4TRKnhs-048OMJexJ=FvU3kgc87x=Qb-csiY9-RqmfkdQ@mail.gmail.com> (raw)
In-Reply-To: <83v9ln7jy4.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 7821 bytes --]

>
> It would be good to know what happens in Emacs during those 88
> seconds.  Please try using "M-x profiler" to find out.
>

Here's what I get with `M-x profiler-start`, using the default cpu sampling,
`C-y` the character into a scratch buffer, wait for the character to show
up,
`M-x profiler-stop`, and start `M-x profiler-report`:

- command-execute                                                  34  68%
 - call-interactively                                              34  68%
  - byte-code                                                      27  54%
   - read-extended-command                                         27  54%
    - completing-read                                              27  54%
     - completing-read-default                                     27  54%
      - read-from-minibuffer                                       20  40%
       - redisplay_internal (C function)                            3   6%
        - tool-bar-make-keymap                                      1   2%
         - tool-bar-make-keymap-1                                   1   2%
          - mapcar                                                  1   2%
           - #<compiled 0x3e964ab88a0e574>                          1   2%
            - eval                                                  1   2%
             - find-image                                           1   2%
                image-search-load-path                              1   2%
        - mode-line-default-help-echo                               1   2%
           window-at-side-p                                         1   2%
        - funcall                                                   1   2%
         - #<compiled -0x1f995e3cc2b2ecb1>                          1   2%
          - gui-backend-selection-exists-p                          1   2%
           - apply                                                  1   2%
              #<compiled 0x6140be5b29e66b5>                         1   2%
       - command-execute                                            1   2%
        - call-interactively                                        1   2%
         - funcall-interactively                                    1   2%
            self-insert-command                                     1   2%
  - funcall-interactively                                           7  14%
   - execute-extended-command                                       7  14%
    - sit-for                                                       6  12%
     - redisplay                                                    5  10%
      - redisplay_internal (C function)                             1   2%
       - tool-bar-make-keymap                                       1   2%
        - tool-bar-make-keymap-1                                    1   2%
         - mapcar                                                   1   2%
          - #<compiled 0x3e964ab88a0e574>                           1   2%
           - eval                                                   1   2%
            - find-image                                            1   2%
               image-search-load-path                               1   2%
    - command-execute                                               1   2%
     - call-interactively                                           1   2%
      - funcall-interactively                                       1   2%
         profiler-stop                                              1   2%
- ...                                                              15  30%
   Automatic GC                                                    11  22%
 - minibuffer-complete                                              4   8%
  - completion-in-region                                            4   8%
   - completion--in-region                                          4   8%
    - #<compiled -0x1e2ae9bfb330a9ab>                               4   8%
     - apply                                                        4   8%
      - #<compiled -0x1803b12e396f20ff>                             4   8%
       - completion--in-region-1                                    4   8%
        - completion--do-completion                                 4   8%
         - completion-try-completion                                2   4%
          - completion--nth-completion                              2   4%
           - completion--some                                       2   4%
            - #<compiled 0x19362eb0698d1781>                        2   4%
             - completion-basic-try-completion                      2   4%
              - try-completion                                      2   4%
               - #<compiled 0x8eea649a66594a4>                      2   4%
                  complete-with-action                              2   4%
         - minibuffer-completion-help                               2   4%
          - completion-all-completions                              1   2%
           - completion--nth-completion                             1   2%
            - completion--some                                      1   2%
             - #<compiled 0x19362eb0508d1781>                       1   2%
              - completion-basic-all-completions                    1   2%
               - completion-pcm--all-completions                    1   2%
                - all-completions                                   1   2%
                 - #<compiled 0x8eea649a66594a4>                    1   2%
                    complete-with-action                            1   2%
          - temp-buffer-window-show                                 1   2%
           - display-buffer                                         1   2%
            - display-buffer-at-bottom                              1   2%
             - window--display-buffer                               1   2%
              - #<compiled -0x142698e7aac52b3a>                     1   2%
               - display-completion-list                            1   2%
                - completion--insert-strings                        1   2%
                 - mapcar                                           1   2%
                    #<compiled -0x6d88f6ac78df9>                    1   2%
- timer-event-handler                                               1   2%
 - apply                                                            1   2%
    #<compiled 0x2393a4a91a526d>                                    1   2%


On Sat, Apr 25, 2020 at 8:51 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Will Bush <will.g.bush@gmail.com>
> > Date: Sat, 25 Apr 2020 05:34:23 -0500
> > Cc: "Basil L. Contovounesios" <contovob@tcd.ie>, 40733@debbugs.gnu.org,
> >  James Cloos <cloos@jhcloos.com>
> >
> > Eli> I'm not sure I understand: you are saying that slow, but correct
> > Eli> display is _worse_ than displaying a white space instead of the
> > Eli> correct glyph, i.e. producing incorrect display?  To me, it sounds
> > Eli> like Emacs 27+ actually _improves_ things in this case.
> >
> > Let me quantify the performance because I've been ambiguous about it so
> far:
> >
> > λ ~/ time emacs -Q --eval '(message "hi")' -kill
> > emacs -Q --eval '(message "hi")' -kill  0.19s user 0.02s system 55% cpu
> 0.371 total
> > λ ~/ time emacs -Q --eval '(message "︵")' -kill
> > emacs -Q --eval '(message "︵")' -kill  81.64s user 0.03s system 99% cpu
> 1:21.91 total
> >
> > It takes ~81 seconds to do something while locking up the UI. That's
> personally
> > beyond my threshold for killing the process.
>
> It would be good to know what happens in Emacs during those 88
> seconds.  Please try using "M-x profiler" to find out.
>

[-- Attachment #2: Type: text/html, Size: 12795 bytes --]

  reply	other threads:[~2020-04-29 11:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 11:05 bug#40733: 28.0.50; Emacs locks up on paste (yank) of unicode characters Will Bush
2020-04-20 15:52 ` Robert Pluim
2020-04-20 16:13   ` Eli Zaretskii
2020-04-20 21:27     ` Will Bush
2020-04-20 20:20   ` Alan Third
2020-04-20 22:48 ` Basil L. Contovounesios
2020-04-21 10:01   ` Robert Pluim
2020-04-21 12:19     ` Will Bush
2020-04-21 13:19       ` Robert Pluim
2020-04-21 19:35         ` James Cloos
2020-04-22  7:35           ` Robert Pluim
2020-04-25 10:34             ` Will Bush
     [not found]               ` <CA+aYz4RNB1-g5uUz-M-XuJEhZPGpA4X6n8NSiTCUdOMkpReFng@mail.gmail.com>
2020-04-25 13:34                 ` bug#40733: Fwd: " Will Bush
2020-04-25 13:50               ` Eli Zaretskii
2020-04-29 11:59                 ` Will Bush [this message]
2020-04-29 12:16                   ` Eli Zaretskii
2020-04-29 12:42                     ` Will Bush
2020-04-29 12:50                       ` Robert Pluim
2020-04-29 14:30                       ` Eli Zaretskii
2020-06-01 11:19                         ` Will Bush
2020-06-01 11:44                           ` Pip Cet
2020-06-01 15:15                             ` Eli Zaretskii
2020-06-01 15:50                               ` Pip Cet
2022-04-24 14:20                           ` Lars Ingebrigtsen
2022-05-18  3:39                             ` Will Bush
2022-05-18 11:18                               ` Eli Zaretskii
2022-06-15 12:40                               ` Lars Ingebrigtsen
2022-06-19 21:05                                 ` Will Bush
2022-06-19 22:25                                   ` Lars Ingebrigtsen
2020-04-21 14:29       ` Eli Zaretskii

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='CA+aYz4TRKnhs-048OMJexJ=FvU3kgc87x=Qb-csiY9-RqmfkdQ@mail.gmail.com' \
    --to=will.g.bush@gmail.com \
    --cc=40733@debbugs.gnu.org \
    --cc=cloos@jhcloos.com \
    --cc=contovob@tcd.ie \
    --cc=eliz@gnu.org \
    --cc=rpluim@gmail.com \
    /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).