help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs hang on heavily templated .H file


From: muede
Subject: Re: Emacs hang on heavily templated .H file
Date: Mon, 13 Jul 2009 12:47:33 -0700 (PDT)
User-agent: G2/1.0

On Jul 11, 8:15 pm, jrwats <jrw...@gmail.com> wrote:
> On Jul 11, 11:06 am, jrwats <jrw...@gmail.com> wrote:
>
> > When I open up file Sequence.h of the Loki template library (http://
> > sysinf0.klabs.be/usr/include/loki/Sequence.h?dist=%3Barch=)
>
> > in emacs, it hangs when attempting to scroll (C-v) the file around the
> > time it hits 58%.  When I run top it is shown to be hogging the CPU @
> > 99%.  I believe the cause to be some poor template parsing (bad loop
> > of some sort?) mechanism in C++-mode.  Is there any way to debug
> > through something like this?
>
> Also note the behavior is notably worse when navigational commands are
> queued up (like holding down C-n to scroll down).

(elp-instrument-package "c-")
<load file, scroll down,wait>
(elp-results)

Function Name                      Call Count  Elapsed Time
================================== ==========  ============
c-forward-<>-arglist-recur         547794      2288.4702050
c-font-lock-declarations           21          249.29225699
c-find-decl-spots                  21          249.29186799
c-forward-type                     2460        249.20125500
c-forward-decl-or-cast-1           671         249.09395900
c-forward-<>-arglist               396         249.05543899
c-forward-name                     2351        248.88187200
c-syntactic-re-search-forward      2190587     169.36424799
[cut]

Looks like a worst-case for the font-lock stuff. As a workaround try
(setq font-lock-maximum-decoration 2)
.

-ap


reply via email to

[Prev in Thread] Current Thread [Next in Thread]