From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kan-Ru Chen Newsgroups: gmane.emacs.devel Subject: Re: Slow fontification in C mode buffers Date: Wed, 14 Dec 2011 23:02:12 +0800 Message-ID: <871us7kxhn.fsf@isil.kanru.info> References: <83vcpxbxn0.fsf@gnu.org> <20111203151824.GA4566@acm.acm> <87pqfso5d3.fsf@isil.kanru.info> <20111214131427.GE4025@acm.acm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323874960 8411 80.91.229.12 (14 Dec 2011 15:02:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2011 15:02:40 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 16:02:35 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RaqLq-0005Wl-0g for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2011 16:02:34 +0100 Original-Received: from localhost ([::1]:55263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaqLp-0004K5-6K for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2011 10:02:33 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaqLj-0004JI-Tc for emacs-devel@gnu.org; Wed, 14 Dec 2011 10:02:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaqLc-00047B-4G for emacs-devel@gnu.org; Wed, 14 Dec 2011 10:02:27 -0500 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:42683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaqLb-00046s-S1; Wed, 14 Dec 2011 10:02:20 -0500 Original-Received: by lahi5 with SMTP id i5so473108lah.0 for ; Wed, 14 Dec 2011 07:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=koIHWSX3LWUJTxTkSMy2fLvWc/Hf5uS1trT99UTurcg=; b=EUJXspt/7dM/jCXqdAHvH1LJ/P8tFhFNeA7dopnn1NhB2sH+vM7MKb/3LL0GfNk0ox 4PUkp9hTaVX9qurnkQcupqNVUQro8+x4QIcp2F52A2WQrmRr+uSrxt9RvCWnAnWpndHL tQz1NKjDJG002XQ90Bk4owmCLz8LbU4ytEZIY= Original-Received: by 10.152.134.50 with SMTP id ph18mr2920240lab.1.1323874938067; Wed, 14 Dec 2011 07:02:18 -0800 (PST) Original-Received: from isil.kanru.info (61-228-151-79.dynamic.hinet.net. [61.228.151.79]) by mx.google.com with ESMTPS id fp3sm2449432lab.12.2011.12.14.07.02.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 07:02:17 -0800 (PST) Original-Received: from localhost.localdomain ([127.0.0.1] helo=isil.kanru.info) by isil.kanru.info with esmtp (Exim 4.77) (envelope-from ) id 1RaqLU-0004O1-Mp; Wed, 14 Dec 2011 23:02:12 +0800 In-Reply-To: <20111214131427.GE4025@acm.acm> (Alan Mackenzie's message of "Wed, 14 Dec 2011 13:14:27 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146710 Archived-At: Hi! Alan Mackenzie writes: > Hello, yet again! > > On Tue, Dec 13, 2011 at 11:31:36PM +0800, Kan-Ru Chen wrote: >> Alan Mackenzie writes: > >> > By a happy coincidence, I've just tracked down another sluggishness (in >> > large array initialisations, reported by Peter Milliken on bug-cc-mode) >> > which looks to have exactly the same cause, namely >> > `c-font-lock-enclosing-decls' which fontifies the innards of a >> > struct/union/enum when jit-lock etc. starts in the middle of it. > >> Is this the same problem? > >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10288 I was editing this file https://hg.mozilla.org/mozilla-central/raw-file/tip/dom/base/nsDOMClassInfo.cpp The one in bug report is a reduced example that has same behavior > As a workaround, put this into your .emacs: > > (add-hook 'c-mode-common-hook > (lambda () (setq c-macro-with-semi-re nil))) > . It gives a speed up of about a factor of 4. Thanks! "Macros with ;" is a very useful tip too. > As a more drastic workaround, disable font-locking with > M-x font-lock-mode The fix for Peter also helps a bit. -- Kanru