From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Date: 25 Sep 2008 14:53:03 +0200 Organization: muc.de e.V. -- private internet access Message-ID: References: Reply-To: Alan Mackenzie , 1024@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1222348317 22426 80.91.229.12 (25 Sep 2008 13:11:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 13:11:57 +0000 (UTC) To: gnu-emacs-bug@moderators.isc.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 15:12:54 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kiqe3-0000X5-TA for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 15:12:36 +0200 Original-Received: from localhost ([127.0.0.1]:51897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kiqd1-00025t-Nd for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 09:11:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kiqbq-0001by-Dr for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 09:10:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kiqbp-0001bU-5q for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 09:10:18 -0400 Original-Received: from [199.232.76.173] (port=38965 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kiqbp-0001bR-0Z for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 09:10:17 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54806) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kiqbo-000604-GT for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 09:10:16 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8PD9sN8017970; Thu, 25 Sep 2008 06:09:54 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8PD03Kj014952; Thu, 25 Sep 2008 06:00:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Thu, 25 Sep 2008 13:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122234720213663 (code B ref -1); Thu, 25 Sep 2008 13:00:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 25 Sep 2008 12:53:22 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8PCrEbH013657 for ; Thu, 25 Sep 2008 05:53:16 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiqLK-0008Cu-JW for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiqLI-0008CW-2q for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:13 -0400 Original-Received: from [199.232.76.173] (port=36045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiqLH-0008CT-Td for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:11 -0400 Original-Received: from moderators.individual.net ([130.133.4.7]:53468) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KiqLH-0002fW-Dj for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:11 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by moderators.individual.net (Exim 4.69) for gnu-emacs-bug@moderators.isc.org with esmtp (envelope-from ) id <1KiqLA-0007Mu-Cj>; Thu, 25 Sep 2008 14:53:04 +0200 Original-Received: (qmail 77721 invoked by uid 8); 25 Sep 2008 12:53:03 -0000 Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Date: Thu, 25 Sep 2008 12:53:03 +0000 (UTC) Original-Lines: 48 Original-NNTP-Posting-Host: marvin.muc.de Original-X-Trace: colin2.muc.de 1222347183 77717 2001:608:1000::2 (25 Sep 2008 12:53:03 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: Thu, 25 Sep 2008 12:53:03 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386)) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 25 Sep 2008 09:10:17 -0400 X-Mailman-Approved-At: Thu, 25 Sep 2008 09:11:25 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20766 Archived-At: Hi, John. John W wrote: > To reproduce: > (1) Generate a 3M C++ file. > (2) Load file. > (3) Wait for emacs. <-- bug > I'm using jit-lock, but I tested lazy-lock, and the behavior is the same. > font-lock-maximum-size is the default. I.e. > Its value is 256000 > I used edebug to see what emacs was doing, and it gave me a stack like: > c-literal-limits() > c-neutralize-syntax-in-CPP(1 3527391 3527390) > funcall(c-neutralize-syntax-in-CPP 1 3527391 3527390) > (if nil c-before-font-lock-function (funcall c-before-font-lock-function (point-min) (point-max) (- ... ...))) > (save-excursion (if c-get-state-before-change-function (funcall c-get-state-before-change-function ... ...)) (if nil c-before-font-lock-function (funcall c-before-font-lock-function ... ... ...))) > (save-restriction (widen) (save-excursion (if c-get-state-before-change-function ...) (if nil c-before-font-lock-function ...))) > c-common-init(c++-mode) > c++-mode() > set-auto-mode-0(c++-mode nil) > set-auto-mode() > normal-mode(t) > after-find-file(nil t) Thanks for taking the trouble to generate this stack dump; it identifies the problem completely. This bug was caused by a previous bug fix which introduced a complete scan over the entire buffer when it's loaded. One function, `c-neutralize-syntax-in-CPP' had been coded very inefficiently. It was recoded for speed on 2008-05-24, committed in .../emacs/lisp/progmodes/cc-mode.el version 1.58.2.12 (Emacs 22 branch) and version 1.75 (trunk) at savannah. To get the fixed version, either: (i) Upgrade to Emacs 22.3; or (ii) If you're using the Emacs 23 CVS, update your version. [ .... ] -- Alan Mackenzie (Nuremberg, Germany).