* Emacs hang on heavily templated .H file
@ 2009-07-11 18:06 jrwats
2009-07-11 18:15 ` jrwats
0 siblings, 1 reply; 3+ messages in thread
From: jrwats @ 2009-07-11 18:06 UTC (permalink / raw)
To: help-gnu-emacs
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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Emacs hang on heavily templated .H file
2009-07-11 18:06 Emacs hang on heavily templated .H file jrwats
@ 2009-07-11 18:15 ` jrwats
2009-07-13 19:47 ` muede
0 siblings, 1 reply; 3+ messages in thread
From: jrwats @ 2009-07-11 18:15 UTC (permalink / raw)
To: help-gnu-emacs
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Emacs hang on heavily templated .H file
2009-07-11 18:15 ` jrwats
@ 2009-07-13 19:47 ` muede
0 siblings, 0 replies; 3+ messages in thread
From: muede @ 2009-07-13 19:47 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-13 19:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-11 18:06 Emacs hang on heavily templated .H file jrwats
2009-07-11 18:15 ` jrwats
2009-07-13 19:47 ` muede
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.