all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: muede <politza@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs hang on heavily templated .H file
Date: Mon, 13 Jul 2009 12:47:33 -0700 (PDT)	[thread overview]
Message-ID: <0557e6f5-5bfe-4141-aa3a-c51746fdc4ad@o36g2000vbl.googlegroups.com> (raw)
In-Reply-To: 128661c5-4aeb-460c-9dc0-5268fcfda0f3@26g2000yqk.googlegroups.com

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	other threads:[~2009-07-13 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0557e6f5-5bfe-4141-aa3a-c51746fdc4ad@o36g2000vbl.googlegroups.com \
    --to=politza@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.