[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c-mode eats resources?
From: |
Kim F. Storm |
Subject: |
Re: c-mode eats resources? |
Date: |
Mon, 20 Feb 2006 09:18:25 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Juri Linkov <address@hidden> 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 <address@hidden> http://www.cua.dk
- c-mode eats resources?, Paul Pogonyshev, 2006/02/18
- Re: c-mode eats resources?, Luc Teirlinck, 2006/02/18
- Re: c-mode eats resources?, Luc Teirlinck, 2006/02/18
- Re: c-mode eats resources?, Luc Teirlinck, 2006/02/18
- Re: c-mode eats resources?, Luc Teirlinck, 2006/02/18
- Re: c-mode eats resources?, Stefan Monnier, 2006/02/19
- Re: c-mode eats resources?, Richard M. Stallman, 2006/02/19