Subject: 23.0.60; High number of different comment lines in a verilog file makes Emacs' verilog-mode unusable slow

From: Mathias Megyei <[email-masked]>
Date: Wed, 17 Sep 2008 10:54:25 +0200

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing 
list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I have a verilog file with 593 lines. It contains 129 lines that start
with comment. (There are more comments in "code" lines but that doesn't
matter.)

After
  emacs -Q
  C-x C-f <file>
  C-end
it takes several minutes until Emacs displays the last page.

I investigated what causes this slowdown and I eventually found that
the number of different comment lines is the reason for that.

If I replace only the half of the comment lines by the same comment
Emacs is much faster.

If I replace all 129 comment lines by the same (random) comment
Emacs is as fast as I would like it to be.

I opened the same file in Emacs 22.2 (verilog-mode-version 404) and
didn't observed such slowness.

Best Regards,

Mathias

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'.
If you would like to further debug the crash, please read the file
/tools/emacs/23.0.60/share/emacs/23.0.60/etc/DEBUG for instructions.

In GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d 
scroll bars)
 of 2008-09-16 on VIHLXCOMP02
Windowing system distributor `The X.Org Foundation', version 11.0.60801000
configured using `configure  '--prefix' '/tools/emacs/23.0.60' 
'--enable-font-backend' '--with-xft=yes' '--with-dbus=yes''

Important settings:
  value of $LC_ALL: C
  value of $LC_COLLATE: C
  value of $LC_CTYPE: de_DE@euro
  value of $LC_MESSAGES: en_US
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Verilog

Minor modes in effect:
  iswitchb-mode: t
  show-paren-mode: t
  cua-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  mouse-sel-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
/ <return> ! <next> <f5> <home> C-M-% <up> <up> <C-right>
<left> <left> <left> { } <return> <up> <up> <C-right>
SPC s t r i n g SPC a k l f d l <return> ! <next> <home>
<next> <next> <next> <next> <next> <next> <next> <next>
<next> <next> C-x C-s <home> <next> <f5> <home> C-M-%
<up> <up> <C-right> <C-right> <C-left> <left> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> # <return> <up> <up>
<return> ! <next> <home> <f5> <home> C-M-% <up> <up>
<C-right> <left> <left> <left> _ <return> <up> <up>
<return> ! <home> <next> <next> <next> <next> <next>
<next> <next> <next> <next> <next> C-x C-s <f5> <home>
C-M-% <up> <up> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> [ <return> <up> <up> <return>
! <end> C-x C-s <f5> <home> <next> <next> <next> <next>
<next> C-M-% <up> <up> <up> <down> <right> <right>
<right> <right> <right> <delete> <delete> <delete>
<delete> <delete> <return> <up> <up> C-e SPC s d k
l f d o f d SPC _ SPC s d k l d f k l f d SPC - SPC
j k k k ` SPC l l d s v l v SPC # SPC \ k d f j k d
f SPC | d f k j d f k l : SPC k j s d j k { s d d s
j k : j d f k } SPC d s j [ s d j d SPC ] s d j k d
k <return> C-M-% <up> <up> <return> <up> <up> <C-right>
<C-right> <C-right> <C-right> <C-right> <C-right> <C-right>
<C-left> <backspace> <return> ! C-x C-s <f5> <home>
C-M-% <return> ! C-x C-s M-x r e p o r <tab> <retu
rn>

Recent messages:
Undo!
Mark set [2 times]
match-substitute-replacement: Invalid use of `\' in replacement text
Mark set
Replaced 70 occurrences
Wrote /home/megyei/otfc.v
Undo!
Mark set [2 times]
Replaced 129 occurrences
Wrote /home/megyei/otfc.v