From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 30 06:16:31 2012 Received: (at submit) by debbugs.gnu.org; 30 Jan 2012 11:16:31 +0000 Received: from localhost ([127.0.0.1]:44682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrpDq-0006VK-Tm for submit@debbugs.gnu.org; Mon, 30 Jan 2012 06:16:31 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35666) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrpDo-0006V6-Uy for submit@debbugs.gnu.org; Mon, 30 Jan 2012 06:16:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrpDU-0004WE-0L for submit@debbugs.gnu.org; Mon, 30 Jan 2012 06:16:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:54099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrpDT-0004WA-V2 for submit@debbugs.gnu.org; Mon, 30 Jan 2012 06:16:07 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrpDO-0005tU-B5 for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2012 06:16:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrpDK-0004VJ-H1 for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2012 06:16:02 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:50511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrpDK-0004VF-AN for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2012 06:15:58 -0500 Received: by wibhj13 with SMTP id hj13so4006783wib.0 for ; Mon, 30 Jan 2012 03:15:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=0ZWCsP2QL+dD9tQHRle0nzgaEui274jixQW6VlcQZ68=; b=jKTVip2jLmO3K1tCvi8EyUWBsOtWzWMwTXPd4bDnbVG7+gTouIMo6eiNeQRKweLMy5 vFQkjpV+ftZXC1E1AvhFVfwJa9/trJWpZcCO69mZ5Pe8I8P5nDskhNJbRfYTjHGLo8yL Jm3UNsMeNIR8KwMa1WKJm1LZwaiSxAKw1abEw= Received: by 10.180.106.33 with SMTP id gr1mr26596999wib.6.1327922157121; Mon, 30 Jan 2012 03:15:57 -0800 (PST) Received: from ix (dial-183239.pool.broadband44.net. [212.46.183.239]) by mx.google.com with ESMTPS id dw7sm14825924wib.4.2012.01.30.03.15.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jan 2012 03:15:55 -0800 (PST) Received: from helmut by ix with local (Exim 4.72) (envelope-from ) id 1RrpDF-0002HD-8d for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2012 12:15:53 +0100 From: Helmut Eller To: bug-gnu-emacs@gnu.org Subject: 24.0.93; font-lock very slow for C++ Date: Mon, 30 Jan 2012 12:15:52 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Font lock is extremely slow in this file: http://hg.openjdk.java.net/jdk7/jdk7/hotspot/raw-file/b92c45f2bc75/src/share/vm/runtime/globals.hpp Download the file and open it with emacs -Q globals.hpp. Then scroll around in the file to see how slow it is. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 26 04:50:21 2012 Received: (at 10652) by debbugs.gnu.org; 26 Feb 2012 09:50:21 +0000 Received: from localhost ([127.0.0.1]:56768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1akH-0003rX-8u for submit@debbugs.gnu.org; Sun, 26 Feb 2012 04:50:21 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:44426) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1akE-0003rP-Q4 for 10652@debbugs.gnu.org; Sun, 26 Feb 2012 04:50:19 -0500 Received: from [155.69.16.142] (port=46699 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S1ahZ-0006ET-7i; Sun, 26 Feb 2012 04:47:33 -0500 From: Chong Yidong To: Alan Mackenzie Subject: Re: bug#10652: 24.0.93; font-lock very slow for C++ References: Date: Sun, 26 Feb 2012 17:47:25 +0800 In-Reply-To: (Helmut Eller's message of "Mon, 30 Jan 2012 12:15:52 +0100") Message-ID: <874nuekjte.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 10652 Cc: Helmut Eller , 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Helmut Eller writes: > Font lock is extremely slow in this file: > > http://hg.openjdk.java.net/jdk7/jdk7/hotspot/raw-file/b92c45f2bc75/src/share/vm/runtime/globals.hpp > > Download the file and open it with emacs -Q globals.hpp. Then > scroll around in the file to see how slow it is. I got Emacs into an uninterruptible loop while scrolling through the buffer :-( Looks like a regression against Emacs 23's CC mode, which handles the file just fine. Alan, could you investigate? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 01 14:37:52 2012 Received: (at 10652) by debbugs.gnu.org; 1 Mar 2012 19:37:52 +0000 Received: from localhost ([127.0.0.1]:57841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Bp1-0001d5-Gg for submit@debbugs.gnu.org; Thu, 01 Mar 2012 14:37:52 -0500 Received: from colin.muc.de ([193.149.48.1]:35657 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3Bon-0001cS-VC for 10652@debbugs.gnu.org; Thu, 01 Mar 2012 14:37:40 -0500 Received: (qmail 31446 invoked by uid 3782); 1 Mar 2012 19:37:08 -0000 Received: from acm.muc.de (pD955650C.dip.t-dialin.net [217.85.101.12]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 01 Mar 2012 20:37:02 +0100 Received: (qmail 19194 invoked by uid 1000); 1 Mar 2012 19:36:22 -0000 Date: Thu, 1 Mar 2012 19:36:22 +0000 To: Chong Yidong Subject: Re: bug#10652: 24.0.93; font-lock very slow for C++ Message-ID: <20120301193622.GA19099@acm.acm> References: <874nuekjte.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874nuekjte.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: Helmut Eller , 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hello Yidong, hello Helmut. On Sun, Feb 26, 2012 at 05:47:25PM +0800, Chong Yidong wrote: > Helmut Eller writes: > > Font lock is extremely slow in this file: > > http://hg.openjdk.java.net/jdk7/jdk7/hotspot/raw-file/b92c45f2bc75/src/share/vm/runtime/globals.hpp > > Download the file and open it with emacs -Q globals.hpp. Then > > scroll around in the file to see how slow it is. > I got Emacs into an uninterruptible loop while scrolling through the > buffer :-( > Looks like a regression against Emacs 23's CC mode, which handles the > file just fine. Alan, could you investigate? Thanks. OK. First point: this is the first time I've ever seen a file with a 3350 line macro. ;-) There are several places in CC Mode which assume macros are small, so it's not too surprising that this file goes slowly. I've elp'd the scrolling, and have the following fix as a first approximation. Please try it out, but it's not fully tested, so don't use it in anger. Just one thing: if you've already got CC Mode running when you load in this version, please do (setq-default c-macro-names-with-semicolon nil) before M-x c++-mode, to clear out a stale value. There are more optimisations I'm looking at at the moment. Here's the patch: diff -r 915250820ea6 cc-engine.el --- a/cc-engine.el Wed Feb 29 18:59:34 2012 +0000 +++ b/cc-engine.el Thu Mar 01 19:23:24 2012 +0000 @@ -222,6 +222,38 @@ (point)))) c-macro-start)) +;; One element macro cache to cope with continual movement within very large +;; CPP macros. +(defvar c-macro-cache nil) +(make-variable-buffer-local 'c-macro-cache) +;; Nil or cons of the bounds of the most recent CPP form probed by +;; `c-beginning-of-macro', `c-end-of-macro' or `c-syntactic-end-of-macro'. +;; The cdr will be nil if we know only the start of the CPP form. +(defvar c-macro-cache-start-pos nil) +(make-variable-buffer-local 'c-macro-cache-start-pos) +;; The starting position from where we determined `c-macro-cache'. +(defvar c-macro-cache-syntactic nil) +(make-variable-buffer-local 'c-macro-cache-syntactic) +;; non-nil iff `c-macro-cache' has both elements set AND the cdr is at a +;; syntactic end of macro, not merely an apparent one. + +(defun c-invalidate-macro-cache (beg end) + ;; Called from a before-change function. If the change region is before or + ;; in the macro characterised by `c-macro-cache' etc., nullify it + ;; appropriately. BEG and END are the standard before-change-functions + ;; parameters. END isn't used. + (cond + ((null c-macro-cache)) + ((< beg (car c-macro-cache)) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil)) + ((and (cdr c-macro-cache) + (< beg (cdr c-macro-cache))) + (setcdr c-macro-cache nil) + (setq c-macro-cache-start-pos beg + c-macro-cache-syntactic nil)))) + (defun c-beginning-of-macro (&optional lim) "Go to the beginning of a preprocessor directive. Leave point at the beginning of the directive and return t if in one, @@ -229,19 +261,36 @@ Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." - (when c-opt-cpp-prefix - (let ((here (point))) - (save-restriction - (if lim (narrow-to-region lim (point-max))) - (beginning-of-line) - (while (eq (char-before (1- (point))) ?\\) - (forward-line -1)) - (back-to-indentation) - (if (and (<= (point) here) - (looking-at c-opt-cpp-start)) - t - (goto-char here) - nil))))) + (let ((here (point))) + (when c-opt-cpp-prefix + (if (and (car c-macro-cache) + (>= (point) (car c-macro-cache)) + (or (and (cdr c-macro-cache) + (<= (point) (cdr c-macro-cache))) + (<= (point) c-macro-cache-start-pos))) + (unless (< (car c-macro-cache) (or lim (point-min))) + (progn (goto-char (max (or lim (point-min)) (car c-macro-cache))) + (setq c-macro-cache-start-pos + (max c-macro-cache-start-pos here)) + t)) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil) + + (save-restriction + (if lim (narrow-to-region lim (point-max))) + (beginning-of-line) + (while (eq (char-before (1- (point))) ?\\) + (forward-line -1)) + (back-to-indentation) + (if (and (<= (point) here) + (looking-at c-opt-cpp-start)) + (progn + (setq c-macro-cache (cons (point) nil) + c-macro-cache-start-pos here) + t) + (goto-char here) + nil)))))) (defun c-end-of-macro () "Go to the end of a preprocessor directive. @@ -251,12 +300,24 @@ Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." - (while (progn - (end-of-line) - (when (and (eq (char-before) ?\\) - (not (eobp))) - (forward-char) - t)))) + (if (and (cdr c-macro-cache) + (<= (point) (cdr c-macro-cache)) + (>= (point) (car c-macro-cache))) + (goto-char (cdr c-macro-cache)) + (unless (and (car c-macro-cache) + (<= (point) c-macro-cache-start-pos) + (>= (point) (car c-macro-cache))) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil)) + (while (progn + (end-of-line) + (when (and (eq (char-before) ?\\) + (not (eobp))) + (forward-char) + t))) + (when (car c-macro-cache) + (setcdr c-macro-cache (point))))) (defun c-syntactic-end-of-macro () ;; Go to the end of a CPP directive, or a "safe" pos just before. @@ -271,12 +332,15 @@ ;; at the start of cc-engine.el for more info. (let* ((here (point)) (there (progn (c-end-of-macro) (point))) - (s (parse-partial-sexp here there))) - (while (and (or (nth 3 s) ; in a string - (nth 4 s)) ; in a comment (maybe at end of line comment) - (> there here)) ; No infinite loops, please. - (setq there (1- (nth 8 s))) - (setq s (parse-partial-sexp here there))) + s) + (unless c-macro-cache-syntactic + (setq s (parse-partial-sexp here there)) + (while (and (or (nth 3 s) ; in a string + (nth 4 s)) ; in a comment (maybe at end of line comment) + (> there here)) ; No infinite loops, please. + (setq there (1- (nth 8 s))) + (setq s (parse-partial-sexp here there))) + (setq c-macro-cache-syntactic (car c-macro-cache))) (point))) (defun c-forward-over-cpp-define-id () diff -r 915250820ea6 cc-fonts.el --- a/cc-fonts.el Wed Feb 29 18:59:34 2012 +0000 +++ b/cc-fonts.el Thu Mar 01 19:23:24 2012 +0000 @@ -409,7 +409,8 @@ (cc-eval-when-compile (boundp 'parse-sexp-lookup-properties))) (BOD-limit - (c-determine-limit 1000))) + (c-determine-limit 500 ;; 1000 + ))) (goto-char (let ((here (point))) (if (eq (car (c-beginning-of-decl-1 BOD-limit)) 'same) diff -r 915250820ea6 cc-langs.el --- a/cc-langs.el Wed Feb 29 18:59:34 2012 +0000 +++ b/cc-langs.el Thu Mar 01 19:23:24 2012 +0000 @@ -444,8 +444,10 @@ ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. t nil - c++ '(c-extend-region-for-CPP c-before-change-check-<>-operators) - (c objc) 'c-extend-region-for-CPP + c++ '(c-extend-region-for-CPP + c-before-change-check-<>-operators + c-invalidate-macro-cache) + (c objc) '(c-extend-region-for-CPP c-invalidate-macro-cache) ;; java 'c-before-change-check-<>-operators awk 'c-awk-record-region-clear-NL) (c-lang-defvar c-get-state-before-change-functions diff -r 915250820ea6 cc-vars.el --- a/cc-vars.el Wed Feb 29 18:59:34 2012 +0000 +++ b/cc-vars.el Thu Mar 01 19:23:24 2012 +0000 @@ -1653,7 +1653,8 @@ c-macro-names-with-semicolon)))))) (defvar c-macro-names-with-semicolon - '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS") +; '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS") + nil "List of #defined symbols whose expansion ends with a semicolon. Alternatively it can be a string, a regular expression which matches all such symbols. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 02 17:29:17 2012 Received: (at 10652) by debbugs.gnu.org; 2 Mar 2012 22:29:17 +0000 Received: from localhost ([127.0.0.1]:59443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3ayS-00088e-KB for submit@debbugs.gnu.org; Fri, 02 Mar 2012 17:29:17 -0500 Received: from colin.muc.de ([193.149.48.1]:38372 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3ayF-000880-UU for 10652@debbugs.gnu.org; Fri, 02 Mar 2012 17:29:05 -0500 Received: (qmail 72742 invoked by uid 3782); 2 Mar 2012 22:28:30 -0000 Received: from acm.muc.de (pD951A7F0.dip.t-dialin.net [217.81.167.240]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 02 Mar 2012 23:28:28 +0100 Received: (qmail 25743 invoked by uid 1000); 2 Mar 2012 22:27:47 -0000 Date: Fri, 2 Mar 2012 22:27:47 +0000 To: Chong Yidong Subject: Re: bug#10652: 24.0.93; font-lock very slow for C++ Message-ID: <20120302222747.GA25732@acm.acm> References: <874nuekjte.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874nuekjte.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: Helmut Eller , 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hello Yidong, hello Helmut. On Sun, Feb 26, 2012 at 05:47:25PM +0800, Chong Yidong wrote: > Helmut Eller writes: > > Font lock is extremely slow in this file: > > http://hg.openjdk.java.net/jdk7/jdk7/hotspot/raw-file/b92c45f2bc75/src/share/vm/runtime/globals.hpp > > Download the file and open it with emacs -Q globals.hpp. Then > > scroll around in the file to see how slow it is. > I got Emacs into an uninterruptible loop while scrolling through the > buffer :-( > Looks like a regression against Emacs 23's CC mode, which handles the > file just fine. Alan, could you investigate? Thanks. I've just committed a collection of optimisations as revision #107485. I can now scroll through the huge macro in that file quite quickly. However, typing in the buffer is still suboptimal. I don't know how much I'll be able to do to sort this out. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 11 05:24:28 2012 Received: (at control) by debbugs.gnu.org; 11 Mar 2012 09:24:28 +0000 Received: from localhost ([127.0.0.1]:44459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6f0t-0005L2-9I for submit@debbugs.gnu.org; Sun, 11 Mar 2012 05:24:27 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:36014) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6f0V-0005KW-Jd for control@debbugs.gnu.org; Sun, 11 Mar 2012 05:24:25 -0400 Received: from bb116-14-103-36.singnet.com.sg ([116.14.103.36]:56886 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S6eXi-0007LZ-I9 for control@debbugs.gnu.org; Sun, 11 Mar 2012 04:54:19 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: merge 10652 10886 Date: Sun, 11 Mar 2012 16:54:11 +0800 Message-ID: <87haxv5xho.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) merge 10652 10886 thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 14 12:45:50 2012 Received: (at 10652) by debbugs.gnu.org; 14 Mar 2012 16:45:50 +0000 Received: from localhost ([127.0.0.1]:50774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S7rKe-0003Np-HP for submit@debbugs.gnu.org; Wed, 14 Mar 2012 12:45:50 -0400 Received: from web1.futureweb.be ([77.243.237.194]:34511) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S7lEi-0001xl-9d for 10652@debbugs.gnu.org; Wed, 14 Mar 2012 06:15:27 -0400 Received: from localhost ([127.0.0.1] helo=tonotdo.com) by web1.futureweb.be with esmtpa (Exim 4.77) (envelope-from ) id 1S7kle-0003VV-2m for 10652@debbugs.gnu.org; Wed, 14 Mar 2012 10:45:14 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_13b53bfbefc10b7e56aa409a1d3e1b0d" Date: Wed, 14 Mar 2012 11:45:14 +0200 From: Toon Claes To: <10652@debbugs.gnu.org> Subject: bug#10652 font-lock very slow for C++ Message-ID: X-Sender: toon@tonotdo.com User-Agent: Roundcube Webmail/0.7.1 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 X-Mailman-Approved-At: Wed, 14 Mar 2012 12:45:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) --=_13b53bfbefc10b7e56aa409a1d3e1b0d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 I'm also having trouble with some cpp files. I've got one file (572 lines, 18560 bytes), that always causes emacs 24 to hang. Emacs 23.3.1 handles this file just fine. I am using emacs from git: commit 6ba3ea4d2625fac8b5fb839f11eeb074d699687e Author: Christopher Schmidt Date: Mon Mar 12 01:31:44 2012 +0800 * ibuffer.el (ibuffer-redisplay): Remove gratuitous error. When GDB was hanging I stopped the process with GDB, with this backtrace: http://pastebin.com/ssB96ue4 I'm not familiar with the emacs source code, but I do not know this is normal. If I can help investigation the problem more in detail, let me know. Unfortunately I am not allowed to share the source file with you. Also I've tried to decrease font-lock-maximum-decoration to 1, but this didn't have effect. --=_13b53bfbefc10b7e56aa409a1d3e1b0d Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

I'm also having trouble with some cpp files.

I've got one file (572 lines, 18560 bytes), that always causes emacs 24 = to hang. Emacs 23.3.1 handles this file just fine.

I am using emacs from git:

commit 6ba3ea4d2625fac8b5fb839f11eeb074d699687e
Author: Christopher= Schmidt <christopher@ch.ristopher.com>
Date:   Mon Ma= r 12 01:31:44 2012 +0800

    * ibuffer.el (ibuffe= r-redisplay): Remove gratuitous error.

 

When GDB was hanging I stopped the process with GDB, with this backtrace= :

http://pastebin.com/ssB96ue4

I'm not familiar with the emacs source code, but I do not know this is n= ormal.

If I can help investigation the problem more in detail, let me know.

Unfortunately I am not allowed to share the source file with you.

 

Also I've tried to decrease font-lock-maximum-decoration to= 1, but this didn't have effect.

 

 
--=_13b53bfbefc10b7e56aa409a1d3e1b0d-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 16 06:50:09 2012 Received: (at 10652) by debbugs.gnu.org; 16 Mar 2012 10:50:09 +0000 Received: from localhost ([127.0.0.1]:53025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8UjX-0005Kz-O5 for submit@debbugs.gnu.org; Fri, 16 Mar 2012 06:50:08 -0400 Received: from colin.muc.de ([193.149.48.1]:10751 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8UjJ-0005KK-UH for 10652@debbugs.gnu.org; Fri, 16 Mar 2012 06:50:05 -0400 Received: (qmail 60521 invoked by uid 3782); 16 Mar 2012 10:19:39 -0000 Received: from acm.muc.de (pD951A238.dip.t-dialin.net [217.81.162.56]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 16 Mar 2012 11:19:37 +0100 Received: (qmail 3784 invoked by uid 1000); 16 Mar 2012 10:18:38 -0000 Date: Fri, 16 Mar 2012 10:18:38 +0000 To: Toon Claes Subject: Re: bug#10652: Recursive loop in alloc.c [ Was: font-lock very slow for C++ ] Message-ID: <20120316101838.GB3439@acm.acm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hello, Emacs and Toon. I've retitled this bug to clarify what it's about. -- Alan Mackenzie (Nuremberg, Germany). On Wed, Mar 14, 2012 at 11:45:14AM +0200, Toon Claes wrote: > I'm also having trouble with some cpp files. > I've got one file > (572 lines, 18560 bytes), that always causes emacs 24 to hang. Emacs > 23.3.1 handles this file just fine. > I am using emacs from git: > commit 6ba3ea4d2625fac8b5fb839f11eeb074d699687e > Author: Christopher > Schmidt > Date: Mon Mar 12 01:31:44 2012 > +0800 > * ibuffer.el (ibuffer-redisplay): Remove gratuitous error. > When GDB was hanging I stopped the process with GDB, with this > backtrace: > http://pastebin.com/ssB96ue4 > I'm not familiar with the > emacs source code, but I do not know this is normal. > If I can help > investigation the problem more in detail, let me know. > Unfortunately I > am not allowed to share the source file with you. > Also I've tried to > decrease font-lock-maximum-decoration to 1, but this didn't have effect. > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 16 07:04:34 2012 Received: (at 10652) by debbugs.gnu.org; 16 Mar 2012 11:04:34 +0000 Received: from localhost ([127.0.0.1]:53029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8UxV-0005eS-Dw for submit@debbugs.gnu.org; Fri, 16 Mar 2012 07:04:33 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55235) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8UxI-0005e8-M3 for 10652@debbugs.gnu.org; Fri, 16 Mar 2012 07:04:31 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3V8NM24jR6z3hj4x; Fri, 16 Mar 2012 11:34:06 +0100 (CET) X-Auth-Info: uzApPVgNvk9KGMRmRdwSHFL23dyL6R1K3m6HmCsNNgk= Received: from igel.home (ppp-93-104-154-158.dynamic.mnet-online.de [93.104.154.158]) by mail.mnet-online.de (Postfix) with ESMTPA id 3V8NM256mDz4KK70; Fri, 16 Mar 2012 11:34:06 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 60CBECA29F; Fri, 16 Mar 2012 11:34:06 +0100 (CET) From: Andreas Schwab To: Alan Mackenzie Subject: Re: bug#10652: Recursive loop in alloc.c [ Was: font-lock very slow for C++ ] References: <20120316101838.GB3439@acm.acm> X-Yow: Barbie says, Take quaaludes in gin and go to a disco right away! But Ken says, WOO-WOO!! No credit at ``Mr. Liquor''!! Date: Fri, 16 Mar 2012 11:34:06 +0100 In-Reply-To: <20120316101838.GB3439@acm.acm> (Alan Mackenzie's message of "Fri, 16 Mar 2012 10:18:38 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: Toon Claes , 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Alan Mackenzie writes: > I've retitled this bug to clarify what it's about. That's just the garbage collector, perfectly normal. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 16 10:50:59 2012 Received: (at 10652) by debbugs.gnu.org; 16 Mar 2012 14:50:59 +0000 Received: from localhost ([127.0.0.1]:53562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8YUa-0003BV-TC for submit@debbugs.gnu.org; Fri, 16 Mar 2012 10:50:58 -0400 Received: from colin.muc.de ([193.149.48.1]:44181 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8YUX-0003BJ-P5 for 10652@debbugs.gnu.org; Fri, 16 Mar 2012 10:50:55 -0400 Received: (qmail 81712 invoked by uid 3782); 16 Mar 2012 14:20:38 -0000 Received: from acm.muc.de (pD951A238.dip.t-dialin.net [217.81.162.56]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 16 Mar 2012 15:20:36 +0100 Received: (qmail 5625 invoked by uid 1000); 16 Mar 2012 14:19:37 -0000 Date: Fri, 16 Mar 2012 14:19:37 +0000 To: Chong Yidong Subject: Re: bug#10652: 24.0.93; font-lock very slow for C++ Message-ID: <20120316141937.GC3439@acm.acm> References: <874nuekjte.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874nuekjte.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: Helmut Eller , 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hello, Yidong, Helmut. On Sun, Feb 26, 2012 at 05:47:25PM +0800, Chong Yidong wrote: > Helmut Eller writes: > > Font lock is extremely slow in this file: > > http://hg.openjdk.java.net/jdk7/jdk7/hotspot/raw-file/b92c45f2bc75/src/share/vm/runtime/globals.hpp > > Download the file and open it with emacs -Q globals.hpp. Then > > scroll around in the file to see how slow it is. > I got Emacs into an uninterruptible loop while scrolling through the > buffer :-( > Looks like a regression against Emacs 23's CC mode, which handles the > file just fine. Alan, could you investigate? Thanks. I've just committed revision #107615, which solves the slow scrolling problem. Typing "electric" characters (e.g. comma) into the buffer is still slower than I'd like, but is tolerable. I don't intend doing any more optimisation before the next pretest (or release :-). -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 16 10:56:15 2012 Received: (at 10652-done) by debbugs.gnu.org; 16 Mar 2012 14:56:15 +0000 Received: from localhost ([127.0.0.1]:53567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8YZh-0003Ir-OG for submit@debbugs.gnu.org; Fri, 16 Mar 2012 10:56:15 -0400 Received: from colin.muc.de ([193.149.48.1]:46270 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8YZg-0003Il-5j for 10652-done@debbugs.gnu.org; Fri, 16 Mar 2012 10:56:12 -0400 Received: (qmail 82258 invoked by uid 3782); 16 Mar 2012 14:25:57 -0000 Received: from acm.muc.de (pD951A238.dip.t-dialin.net [217.81.162.56]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 16 Mar 2012 15:25:56 +0100 Received: (qmail 5664 invoked by uid 1000); 16 Mar 2012 14:24:57 -0000 Date: Fri, 16 Mar 2012 14:24:57 +0000 To: 10652-done@debbugs.gnu.org Subject: Re: bug#10652: 24.0.93; font-lock very slow for C++ Message-ID: <20120316142457.GD3439@acm.acm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 10652-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.4 (/) Fixed. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 28 03:39:24 2012 Received: (at 10652) by debbugs.gnu.org; 28 Mar 2012 07:39:24 +0000 Received: from localhost ([127.0.0.1]:42191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SCnTS-00048p-Ow for submit@debbugs.gnu.org; Wed, 28 Mar 2012 03:39:24 -0400 Received: from web1.futureweb.be ([77.243.237.194]:57652) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SCnSu-00047i-67 for 10652@debbugs.gnu.org; Wed, 28 Mar 2012 03:39:17 -0400 Received: from localhost ([127.0.0.1] helo=tonotdo.com) by web1.futureweb.be with esmtpa (Exim 4.77) (envelope-from ) id 1SCmyZ-0001fI-Am; Wed, 28 Mar 2012 09:07:23 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_b59b30a4ca1038daafdef7c99019e40a" Date: Wed, 28 Mar 2012 09:07:23 +0200 From: Toon Claes To: Alan Mackenzie , <10652@debbugs.gnu.org> Subject: bug#10652 font-lock very slow for C++ Message-ID: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> X-Sender: toon@tonotdo.com User-Agent: Roundcube Webmail/0.7.1 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) --=_b59b30a4ca1038daafdef7c99019e40a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 Hello Alan, Your changes indeed help. Still it happens emacs completely hangs when isearching. So I do not really agree the bug is fixed. I can (but not really allowed to) send you the cpp file which causes trouble. If you agree to not distribute it? Regards, Toon --=_b59b30a4ca1038daafdef7c99019e40a Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

Hello Alan,

 

Your changes indeed help.

Still it happens emacs completely hangs when isearching. So I do not rea= lly agree the bug is fixed.

I can (but not really allowed to) send you the cpp file which causes tro= uble. If you agree to not distribute it?

 

Regards,

Toon

 

 

 
--=_b59b30a4ca1038daafdef7c99019e40a-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 06:08:22 2012 Received: (at 10652) by debbugs.gnu.org; 29 Mar 2012 10:08:22 +0000 Received: from localhost ([127.0.0.1]:44112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDCHF-0004WU-B8 for submit@debbugs.gnu.org; Thu, 29 Mar 2012 06:08:22 -0400 Received: from colin.muc.de ([193.149.48.1]:37290 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDCGy-0004Vf-Ml for 10652@debbugs.gnu.org; Thu, 29 Mar 2012 06:08:20 -0400 Received: (qmail 88379 invoked by uid 3782); 29 Mar 2012 09:36:36 -0000 Received: from acm.muc.de (pD951B3B6.dip.t-dialin.net [217.81.179.182]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 29 Mar 2012 11:36:34 +0200 Received: (qmail 3004 invoked by uid 1000); 29 Mar 2012 09:35:18 -0000 Date: Thu, 29 Mar 2012 09:35:18 +0000 To: Toon Claes Subject: Re: bug#10652 font-lock very slow for C++ Message-ID: <20120329093517.GA2961@acm.acm> References: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi, Toon. On Wed, Mar 28, 2012 at 09:07:23AM +0200, Toon Claes wrote: > Hello Alan, > Your changes indeed help. > Still it happens emacs > completely hangs when isearching. So I do not really agree the bug is > fixed. Sorry about that! Can I assume (i) You've already tried this, starting Emacs with Emacs -Q? (ii) Youre using the latest version of Emacs 24? Searching and C++ Mode are, as far as I know, completely orthogonal. Before going any further, could you please try switching the file into fundamental mode (with M-x fundamental-mode) and tell me if the search still hangs. Thanks! [ .... ] > Regards, > Toon -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 16:18:04 2012 Received: (at 10652) by debbugs.gnu.org; 29 Mar 2012 20:18:04 +0000 Received: from localhost ([127.0.0.1]:45281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDLmr-0005Dt-1I for submit@debbugs.gnu.org; Thu, 29 Mar 2012 16:18:04 -0400 Received: from web1.futureweb.be ([77.243.237.194]:44107) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDLmo-0005Dj-7s for 10652@debbugs.gnu.org; Thu, 29 Mar 2012 16:17:35 -0400 Received: from 94-226-220-152.access.telenet.be ([94.226.220.152] helo=[192.168.2.2]) by web1.futureweb.be with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SDLIJ-0001dF-M3; Thu, 29 Mar 2012 21:46:03 +0200 To: Alan Mackenzie References: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> <20120329093517.GA2961@acm.acm> X-Universally-Unique-Identifier: 03414afd-62e3-4e04-8cce-6ff3a21e9104 In-Reply-To: <20120329093517.GA2961@acm.acm> Mime-Version: 1.0 (Apple Message framework v1257) From: Toon Claes Content-Type: text/plain; charset=utf-8 X-Apple-Mail-Signature: Message-Id: <79C7C145-A878-4C38-9B5F-95DFC30C68CD@tonotdo.com> Content-Transfer-Encoding: quoted-printable X-Mailer: iPad Mail (9B176) X-Apple-Windows-Friendly: 1 X-Apple-Mail-Remote-Attachments: YES X-Apple-Auto-Saved: 1 X-Apple-Base-Url: x-msg://162/ X-Uniform-Type-Identifier: com.apple.mail-draft Date: Thu, 29 Mar 2012 21:46:03 +0200 Subject: Re: bug#10652 font-lock very slow for C++ X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: "10652@debbugs.gnu.org" <10652@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi Alan, About: (i) yes I've tried that, emacs -Q didn't make a difference (ii) I am using emacs from git, commit 2ac37884107bd4e78bb=E2=80=A6 Should I= get it from the bazaar repo? (iii) I know font-lock has nothing to do with isearch. When I disable font-l= ock-mode for the buffer, isearch does not hang. So the issue isn't isearch. S= orry I created some confusion in previous mail. Toon On 29 Mar 2012, at 11:35, Alan Mackenzie wrote: > Hi, Toon. >=20 > On Wed, Mar 28, 2012 at 09:07:23AM +0200, Toon Claes wrote: >=20 >=20 >> Hello Alan,=20 >=20 >> Your changes indeed help.=20 >=20 >> Still it happens emacs >> completely hangs when isearching. So I do not really agree the bug is >> fixed.=20 >=20 > Sorry about that! Can I assume > (i) You've already tried this, starting Emacs with Emacs -Q? > (ii) Youre using the latest version of Emacs 24? >=20 > Searching and C++ Mode are, as far as I know, completely orthogonal. > Before going any further, could you please try switching the file into > fundamental mode (with M-x fundamental-mode) and tell me if the search > still hangs. Thanks! >=20 > [ .... ] >=20 >> Regards,=20 >=20 >> Toon=20 >=20 > --=20 > Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 18:33:20 2012 Received: (at 10652) by debbugs.gnu.org; 29 Mar 2012 22:33:20 +0000 Received: from localhost ([127.0.0.1]:45426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDNuB-00009h-BF for submit@debbugs.gnu.org; Thu, 29 Mar 2012 18:33:20 -0400 Received: from colin.muc.de ([193.149.48.1]:27583 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDNu8-00009Z-FA for 10652@debbugs.gnu.org; Thu, 29 Mar 2012 18:33:17 -0400 Received: (qmail 47437 invoked by uid 3782); 29 Mar 2012 22:01:46 -0000 Received: from acm.muc.de (pD95579D5.dip.t-dialin.net [217.85.121.213]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 30 Mar 2012 00:01:43 +0200 Received: (qmail 3186 invoked by uid 1000); 29 Mar 2012 22:00:26 -0000 Date: Thu, 29 Mar 2012 22:00:26 +0000 To: Toon Claes Subject: Re: bug#10652 font-lock very slow for C++ Message-ID: <20120329220026.GC2594@acm.acm> References: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> <20120329093517.GA2961@acm.acm> <79C7C145-A878-4C38-9B5F-95DFC30C68CD@tonotdo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <79C7C145-A878-4C38-9B5F-95DFC30C68CD@tonotdo.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: "10652@debbugs.gnu.org" <10652@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hello, Toon. On Thu, Mar 29, 2012 at 09:46:03PM +0200, Toon Claes wrote: > Hi Alan, > About: > (i) yes I've tried that, emacs -Q didn't make a difference Worth knowing > (ii) I am using emacs from git, commit 2ac37884107bd4e78bb… Should I > get it from the bazaar repo? I'm not familiar with the git repository. If the revision is recent (within the last week or two or three) it should be OK. I just wanted to check you weren't using a 6-month old version. > (iii) I know font-lock has nothing to do with isearch. When I disable > font-lock-mode for the buffer, isearch does not hang. So the issue > isn't isearch. Sorry I created some confusion in previous mail. OK. What I suspect is that the isearch works fine, then the fontification hangs before the screen can redisplay. How long does it hang for? Any chance you could perhaps leave it hanging over lunchtime, or perhaps even overnight to see if it might just be _very_ slow. Could you perhaps try disabling font-lock, doing the isearch, then enabling font-lock again. Does it then still hang, or does it come up OK? Lastly, is there anything unusual about your test file. Perhaps long regions of text which contain no semicolons or maybe no braces? Or maybe hundreds of macro definitions one after the other, something like that? > Toon -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 03:48:33 2012 Received: (at 10652) by debbugs.gnu.org; 2 Apr 2012 07:48:33 +0000 Received: from localhost ([127.0.0.1]:35332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEc08-0007e7-A2 for submit@debbugs.gnu.org; Mon, 02 Apr 2012 03:48:33 -0400 Received: from web1.futureweb.be ([77.243.237.194]:37073) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEc04-0007dy-PP for 10652@debbugs.gnu.org; Mon, 02 Apr 2012 03:48:31 -0400 Received: from localhost ([127.0.0.1] helo=tonotdo.com) by web1.futureweb.be with esmtpa (Exim 4.77) (envelope-from ) id 1SEbzo-0002HV-Oh; Mon, 02 Apr 2012 09:48:12 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_0054d125467ef90f40bda238c8a1805e" Date: Mon, 02 Apr 2012 09:48:12 +0200 From: Toon Claes To: Alan Mackenzie Subject: Re: bug#10652 font-lock very slow for C++ In-Reply-To: <20120329220026.GC2594@acm.acm> References: <05ad2fb77a606d40fcdd51af095a5280@tonotdo.com> <20120329093517.GA2961@acm.acm> <79C7C145-A878-4C38-9B5F-95DFC30C68CD@tonotdo.com> <20120329220026.GC2594@acm.acm> Message-ID: <3cd3c01ead9ed4dc9ceca684516e88d3@tonotdo.com> X-Sender: toon@tonotdo.com User-Agent: Roundcube Webmail/0.7.1 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10652 Cc: 10652@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) --=_0054d125467ef90f40bda238c8a1805e Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 Hi Alan, emacs hangs for hours. Luckily it only used one of my 4 processor cores, so I could leave it loading in the background. This is what I've done: Open the file, in c++-mode, and scroll to end-of-buffer (M->). The mouse cursor starts spinning, but the end of buffer is not shown. When I press C-g three times, the end of the buffer is shown. The fontification looks correct. When I go back to beginning-of-buffer, same problem. When I press M->, M-< several times, I cannot recover with C-g and I need to kill emacs:-( isearch works fine with font-lock-mode disabled. Even, depending on the position in the buffer, it happens the command M-x font-lock-mode gives the spinning mouse cursor. Again 3x C-g solves this. So I can say pretty sure, font-lock-mode is causing the "delay". I've tested again with the bazaar version of last friday. My test file contains something like this: int ClassName::MethodAbc(void) { SOME_PRETEST_MACRO; return TranslateResult(LibFunctionAbc(m_Member)); } And this repeated for something like 20 times (of course with different names, and with different parameters). The macro is something like: #define SOME_PRETEST_MACRO if (!Ready()) return -1; With this test file, I could easily reproduce the problem. I hope this can help investigating the issue. Toon On 2012-03-30 00:00, Alan Mackenzie wrote: > Hello, Toon. > > On Thu, Mar 29, 2012 at 09:46:03PM +0200, Toon Claes wrote: > >> Hi Alan, > >> About: (i) yes I've tried that, emacs -Q didn't make a difference > > Worth knowing --=_0054d125467ef90f40bda238c8a1805e Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

Hi Alan,

 

emacs hangs for hours. Luckily it only used one of my 4 processor cores,= so I could leave it loading in the background.

This is what I've done:

Open the file, in c++-mode, and scroll to end-of-buffer (M->). The mo= use cursor starts spinning, but the end of buffer is not shown.

When I press C-g three times, the end of the buffer is shown. The fontif= ication looks correct.

When I go back to beginning-of-buffer, same problem.

When I press M->, M-< several times, I cannot recover with C-g and= I need to kill emacs:-(

 

isearch works fine with font-lock-mode disabled.

Even, depending on the position in the buffer, it happens the command M-= x font-lock-mode gives the spinning mouse cursor. Again 3x C-g solves this= =2E

So I can say pretty sure, font-lock-mode is causing the "delay".

 

I've tested again with the bazaar version of last friday.

 

My test file contains something like this:

    int ClassName::MethodAbc(void)

    {

      SOME_PRETEST_MACRO;

      return TranslateResult(LibFunctionAbc(m_M= ember));

    }

 

And this repeated for something like 20 times (of course with different = names, and with different parameters).

The macro is something like:

    #define SOME_PRETEST_MACRO   if (!Ready()) = return -1;

 

With this test file, I could easily reproduce the problem.

I hope this can help investigating the issue.

 

 

Toon

 

 

 

On 2012-03-30 00:00, Alan Mackenzie wrote:

Hello, Toon.

On Thu, Mar 29, 2012 at 09:46:03PM +0200, Toon Claes wrote:
Hi Alan,
About: (i) yes I've tried that, emacs= -Q didn't make a difference
Worth knowing
(ii) I am using emacs from git, commi= t 2ac37884107bd4e78bb… Should I get it from the bazaar repo?
I'm not familiar with the git repository.  If the revision is recent
(within the last week or two or three) it should be OK.  I just wanted to
check you weren't using a 6-month old version.
(iii) I know font-lock has nothing to= do with isearch. When I disable font-lock-mode for the buffer, isearch doe= s not hang. So the issue isn't isearch. Sorry I created some confusion in p= revious mail.
OK.  What I suspect is that the isearch works fine, then the
fontification hangs before the screen can redisplay.  How long does it
hang for?  Any chance you could perhaps leave it hanging over lunchtime,
or perhaps even overnight to see if it might just be _very_ slow.

Could you perhaps try disabling font-lock, doing the isearch, then
enabling font-lock again.  Does it then still hang, or does it come up
OK?

Lastly, is there anything unusual about your test file.  Perhaps long
regions of text which contain no semicolons or maybe no braces?  Or maybe
hundreds of macro definitions one after the other, something like that?
Toon

 

 
--=_0054d125467ef90f40bda238c8a1805e-- From unknown Fri Jun 20 18:19:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 30 Apr 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator