Subject: Re: bug#20611: 24.4; mutt slow in ansi-term

From: Alexis <[email-masked]>
Date: Mon, 11 Apr 2016 08:22:09 +1000

Eli Zaretskii <[email-masked]> writes:
 
>> I have just tried alsamixer within ansi-term, and redraws in 
>> response to Ctrl-L take well over a second.
>
> Strange.  Does anyone else see this?

Context: Debian Jessie x86_64 / i5-2410M.

i also observe noticeable lag in the above situation, on both on 
24.5 and on master as at d6ea6453. The lag is worse on the latter 
than the former.

> Can you show a profile ("M-x profiler-start RET") of the slow 
> redraws?  Preferably with the latest pretest of Emacs 25.1, if 
> you can.

Running the profiler on master:

#+BEGIN
- term-emulate-terminal 
  4233  91% 
 - term-handle-ansi-escape 
 4065  87% 
  - term-goto 
  3965  85% 
   - term-down 
   970  20% 
    - vertical-motion 
    4   0% 
       jit-lock-function 
       4   0% 
   - vertical-motion 
   4   0% 
    - jit-lock-function 
    4   0% 
     - jit-lock-fontify-now 
     4   0% 
      - jit-lock--run-functions 
      4   0% 
       - run-hook-wrapped 
       4   0% 
        - #<compiled 0xa9010f> 
        4   0% 
         - font-lock-fontify-region 
         4   0% 
            font-lock-default-fontify-region 
            4   0% 
    term-insert-spaces 
    100   2% 
   redisplay 
   40   0% jit-lock-after-change 
   4   0% 
+ command-execute 
352   7% + ... 
29   0% 
  and 
  8   0% 
+ redisplay_internal (C function) 
4   0% + timer-event-handler 
2   0% #+END

Hth.

Alexis.