Subject: 23.0.60; Excess consing visiting files

From: "Richard M. Stallman" <[email-masked]>
Date: Thu, 11 Sep 2008 07:03:36 -0400

I have noticed that there are times when just typing o in Dired
to visit a fairly small file causes a GC every time.
It does not do that when I first start Emacs, but it does
do an unreasonable amount of consing.

I did `emacs -Q', then defined the functions gc-set-base and
gc-info as shown in my other message.  Then I visited a directory
in which the following file was called out-35:

======================================================================
Content-Type: text/plain; charset=ISO-8859-15
From: "Richard M. Stallman" <[email-masked]>
To: rms
Subject: Testing
bcc: [email-masked]
Reply-to: [email-masked]
--text follows this line--
This is a test message so I can see how much consing Emacs does.
======================================================================

Just to make things more stable, I typed o for another file in the
directory first.  Then I moved to the line for out-35, and typed M-* o
M-* and got this output:

In Emacs 23

C=47815 S=6631(92347) V=276 SYM=8 MISC=2674 INT=1173
C=58843 S=9776(135489) V=285 SYM=9 MISC=2727 INT=1174

In Emacs 22.2

C=21999 S=2025(39136) V=118 SYM=2 MISC=3904 INT=654
C=23214 S=2729(51808) V=118 SYM=3 MISC=4121 INT=655

They are both unreasonably large, but Emacs 23 conses 40k
of strings, which is really amazing for a 215-character file.

When I get into the situation where each file I visit causes
a GC, I will measure that.

In GNU Emacs 23.0.60.6 (mipsel-unknown-linux-gnu, GTK+ Version 2.12.11)
 of 2008-09-10 on lemote-menglan
configured using `configure  'CFLAGS=-O0 -g -Wno-pointer-sign' 'mipsel-unknown-linux-gnu' 'build_alias=mipsel-unknown-linux-gnu' 'host_alias=mipsel-unknown-linux-gnu' 'target_alias=mipsel-unknown-linux-gnu''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Mail

Minor modes in effect:
  gpm-mouse-mode: t
  tooltip-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
2 3 C-u C-n C-n I n SPC E m a c s SPC 2 2 . 2 RET RET 
C-x i f o o RET C-a C-u C-p C-p C-p C-p C-o C-o I SPC 
m a d e SPC a SPC C-a C-k I SPC h a v e SPC n o t i 
c e d SPC t h a t SPC s o e t i m e s C-u C-b C-b C-b 
m C-e SPC j u s t SPC t y p i n g SPC o SPC i n SPC 
D i r e d RET t o SPC v i s i t SPC a SPC f a i r l 
y SPC s m a l l SPC f i l e SPC c a u s e s SPC a SPC 
G C SPC e v e r y SPC t i m e . RET I t SPC d o e s 
SPC n t SPC d o ESC b C-b C-b o C-e t h a t C-u C-b 
SPC C-e SPC w h e n SPC I SPC f i r s t SPC s t a r 
t SPC E a c DEL DEL m a c s , SPC b u t SPC i t SPC 
d i e s RET DEL DEL DEL DEL o e d RET d o SPC C-p C-e 
DEL s C-n SPC DEL a n SPC u n r e a s o n a b l e SPC 
a m o u t SPC DEL DEL n t SPC o f SPC c o n s i n g 
, C-a C-p C-p C-p C-u C-u C-u C-k ESC x r e p o r t 
TAB RET

Recent messages:
Sending...
Wrote /home/rms/outgoing/out-34
Sending...done
Expunging deleted messages...done
Quit [2 times]
Sending...
Wrote /home/rms/outgoing/out-35
Sending...done
Mark set [3 times]
Auto-saving...done