all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: pogonyshev@gmx.net, Luc Teirlinck <teirllm@dms.auburn.edu>,
	emacs-devel@gnu.org
Subject: Re: c-mode eats resources?
Date: Mon, 20 Feb 2006 09:18:25 +0100	[thread overview]
Message-ID: <m3zmkmmoj2.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <878xs7mgzx.fsf@jurta.org> (Juri Linkov's message of "Sun, 19 Feb 2006 19:18:57 +0200")

Juri Linkov <juri@jurta.org> writes:

>>    Apparently, C mode constantly uses processor time even nothing is
>>    done in the buffer.  E.g. if I open a C file in Emacs and go to a
>>    different desktop and start `top' there, it shows Emacs in the
>>    first few lines with 3--7% usage of CPU.  This cannot be right.
>>    Can anybody reproduce this?
>
> This problem can be reproduced with the following code evaluated
> on a buffer in C mode:
>
> (let ((start (float-time)))
>   (font-lock-mode 1)
>   (jit-lock-fontify-now (point-min) (point-max))
>   (- (float-time) start))
>
>> Did you customize font-lock related stuff to use potentially
>> inefficient regexps?
>
> I don't know whether due to very inefficient regexps or not, but in
> the last few months fontification in C mode deteriorated drastically.
> Evaluating the code above on alloc.c using `emacs -q --no-site-file'
> on 1GHZ in different Emacs versions produces the following results:
>
> GNU Emacs 21.4 - 0.5 sec
> CVS 2004-04    - 3.5 sec
> CVS 2005-09    - 6.8 sec
> CVS 2006-02    - 10.0 sec
>
> Given a few percents of CPU utilization, no wonder that stealth
> fontification lasts several minutes.

Does it help to increase the size of the regexp cache in search.c?

#define REGEXP_CACHE_SIZE 20

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2006-02-20  8:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-18 21:07 c-mode eats resources? Paul Pogonyshev
2006-02-18 22:40 ` Chong Yidong
2006-02-18 23:12   ` Paul Pogonyshev
2006-02-19 11:12     ` martin rudalics
2006-02-18 22:47 ` Lennart Borgman
2006-02-18 23:12 ` Luc Teirlinck
2006-02-19 17:18   ` Juri Linkov
2006-02-19 23:31     ` Andreas Schwab
2006-02-20  8:18     ` Kim F. Storm [this message]
2006-02-20 19:33       ` Juri Linkov
2006-02-18 23:17 ` Luc Teirlinck
2006-02-19  0:02 ` Luc Teirlinck
2006-02-19 11:54   ` Paul Pogonyshev
2006-02-19  0:05 ` Luc Teirlinck
2006-02-19  1:00 ` Luc Teirlinck
2006-02-19 15:17 ` Stefan Monnier
2006-02-19 22:47 ` Richard M. Stallman

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=m3zmkmmoj2.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmx.net \
    --cc=teirllm@dms.auburn.edu \
    /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.