From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: c-mode eats resources? Date: Sun, 19 Feb 2006 19:18:57 +0200 Organization: JURTA Message-ID: <878xs7mgzx.fsf@jurta.org> References: <200602182307.38095.pogonyshev@gmx.net> <200602182312.k1INCmL06749@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1140388298 6735 80.91.229.2 (19 Feb 2006 22:31:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2006 22:31:38 +0000 (UTC) Cc: emacs-devel@gnu.org, pogonyshev@gmx.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 19 23:31:37 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAx5b-0003sJ-1g for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2006 23:31:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAx5a-00039H-Fv for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2006 17:31:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FAsKF-0006vl-1c for emacs-devel@gnu.org; Sun, 19 Feb 2006 12:26:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FAsFz-00059O-E8 for emacs-devel@gnu.org; Sun, 19 Feb 2006 12:22:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAsDZ-0004MS-9c for emacs-devel@gnu.org; Sun, 19 Feb 2006 12:19:29 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FAsJP-000485-Hd for emacs-devel@gnu.org; Sun, 19 Feb 2006 12:25:31 -0500 Original-Received: from mail.neti.ee (80-235-43-236-dsl.mus.estpak.ee [80.235.43.236]) by Relayhost1.neti.ee (Postfix) with ESMTP id CD7C660E0; Sun, 19 Feb 2006 19:19:22 +0200 (EET) Original-To: Luc Teirlinck In-Reply-To: <200602182312.k1INCmL06749@raven.dms.auburn.edu> (Luc Teirlinck's message of "Sat, 18 Feb 2006 17:12:48 -0600 (CST)") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50758 Archived-At: > 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. -- Juri Linkov http://www.jurta.org/emacs/