Subject: Fwd: 24.3; Slow scrolling in term modes

From: Bryan Bishop <[email-masked]>
Date: Sun, 24 Mar 2013 23:42:10 -0500

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

The window scrolling performance ("multi-term" and plain old "term" in
this case) in emacs 24 is terrible after a few thousand lines of
scrollback, slowly getting worse and worse and after about 5000 lines of
scrollback takes about a 1/2 second to render the next chunk of text.

How I can replicate the problem:

emacs -Q
M-x term
find /

(The output of the find command whizzes by, and then starts to get jerky
and slow when scrollback history is > 2000 lines)

I've installed the stock emacs24 from linux mint/ubuntu packages
(24.1.1), and a custom
compiled version of 24.3.1 without any special tricks and a compiler
option of -O3 and the term mode behavior is all the same, and this
behavior even shows up with "emacs -Q".

It seems the same with multi-term, ansi-term, nterm, it doesn't matter.
This does work very fast in eshell and in terminal-emulator mode.
What is weird is ALL the terminal modes in Emacs 23 seem to work
great, but not Emacs 24.

Any ideas how I can make this mode faster?  My suspicion was around
font-lock-mode but I've turned that off with no effect.  The fact that
it is still slow without my init file using -Q and seems to be really
fast in Emacs 23 has me stumped.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/local/share/emacs/24.3/etc/DEBUG.

In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2013-03-13 on badwolf
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description:    Linux Mint 14 Nadia

Configured using:
 `configure '--prefix=/usr/local' 'CFLAGS=-O3''

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Buffer Menu

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x 1 M-x t e r m <return> <return>
f i n d <return> C-c C-c C-c C-c C-c C-c e x i t <return>

Recent messages:
byte-code: Beginning of buffer [14 times]
Quit [2 times]
Mark set
Sending...
Already sent message via mail; resend? (y or n)  y
Mark set [2 times]
Sending via mail...
Sending...done
Mark set
Saved text from "The window scrolling performance ("multi"

Load-path shadows:
None found.

Features:
(mule-util mailalias mailclient browse-url cus-edit cus-start cus-load
wid-edit shadow sort gnus-util mail-extr emacsbug message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils term disp-table ehelp electric ring
help-mode easymenu time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting x-toolkit x multi-tty emacs)