From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7069: Compilation from within emacs becomes slower and slower until Emacs is restarted Date: Wed, 20 Apr 2011 10:10:30 -0300 Message-ID: References: <4DAEAFB9.8090900@sdu.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1303306662 9775 80.91.229.12 (20 Apr 2011 13:37:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Apr 2011 13:37:42 +0000 (UTC) Cc: 7069@debbugs.gnu.org To: Lars Hamren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 20 15:37:37 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1QCXb3-0008KM-Ti for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Apr 2011 15:37:34 +0200 Original-Received: from localhost ([::1]:35492 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCXb3-0004H6-EZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Apr 2011 09:37:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCXaz-0004DX-Vs for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2011 09:37:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCXay-0007da-SS for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2011 09:37:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCXay-0007dT-QX for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2011 09:37:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QCXBO-0001oG-CG; Wed, 20 Apr 2011 09:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Apr 2011 13:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7069-submit@debbugs.gnu.org id=B7069.13033050416924 (code B ref 7069); Wed, 20 Apr 2011 13:11:02 +0000 Original-Received: (at 7069) by debbugs.gnu.org; 20 Apr 2011 13:10:41 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QCXB2-0001nc-Rf for submit@debbugs.gnu.org; Wed, 20 Apr 2011 09:10:41 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QCXB1-0001nS-66 for 7069@debbugs.gnu.org; Wed, 20 Apr 2011 09:10:39 -0400 Original-Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:50450 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QCXAu-0004ST-P0; Wed, 20 Apr 2011 09:10:33 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id D55A0662B5; Wed, 20 Apr 2011 10:10:30 -0300 (ART) In-Reply-To: <4DAEAFB9.8090900@sdu.se> (Lars Hamren's message of "Wed, 20 Apr 2011 12:04:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 20 Apr 2011 09:11:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45882 Archived-At: > (add-hook 'compilation-mode-hook > (lambda () (setq compilation-error-regexp-alist > (cons > ;; Quartus II error messages > '(".*Verilog .* at \\(.+\\)(\\([0-9]+\\)): .*" 1 2) > compilation-error-regexp-alist)))) There are various optimizations you can do on this regexp (such as remove the trailing ".*"), but the only one I can see that should make a significant difference in terms of performance is the leading ".*". I.e. remove the ".*" at the beginning (compilation regexps are not anchored at the BOL since Emacs-22, IIRC). This should speed things up significantly. If you insist on keeping the ".*" because you like the resulting highlighting, then add a "^" before it. > I haven't looked further into why this should be a problem. I can't think of any reason why this regexp should make compilation become slower (I can see why it would make it slow, but unless lines become longer over time, it should keep the same slowness at the end as it had at the beginning). Then again, this may depend on the version of Emacs you're using. I've made some changes to the way compilation messages are parsed in the upcoming Emacs-24 code (not specifically for performance reasons, but it does impact performance), so if you could try out the development code that would be helpful: I'd like to resolve such performance bugs before Emacs-24 is released. > The regexp is quite simple, and doesn't match when compiling with g++. Depending on the shape of the regexp, the "doesn't match" case can be the worst case, because the regexp-matcher has to try *all* the possible ways in which it might match before reporting a match failure, whereas a successful match would stop as soon as the first way to match is found. Stefan