From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#13369: 24.1; compile message parsing slow because of omake hack Date: Sun, 6 Jan 2013 21:03:05 +0100 Message-ID: <672E6DB1-196D-491C-BE42-F29CF1C7F1A5@bredband.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1357502692 12584 80.91.229.3 (6 Jan 2013 20:04:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jan 2013 20:04:52 +0000 (UTC) To: 13369@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 21:05:08 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TrwSw-0006JJ-BR for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2013 21:05:06 +0100 Original-Received: from localhost ([::1]:56762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwSg-0002HG-SQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2013 15:04:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwSb-0002H5-TL for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:04:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrwSY-0004gw-TB for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:04:45 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwSY-0004gj-PR for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:04:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TrwSs-0002z2-77 for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jan 2013 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135750265111395 (code B ref -1); Sun, 06 Jan 2013 20:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jan 2013 20:04:11 +0000 Original-Received: from localhost ([127.0.0.1]:48407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TrwS2-0002xi-06 for submit@debbugs.gnu.org; Sun, 06 Jan 2013 15:04:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46295) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TrwRl-0002xC-SF for submit@debbugs.gnu.org; Sun, 06 Jan 2013 15:04:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrwRP-0004TJ-Rj for submit@debbugs.gnu.org; Sun, 06 Jan 2013 15:03:34 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:37871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwRP-0004TF-Oh for submit@debbugs.gnu.org; Sun, 06 Jan 2013 15:03:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwRM-00026x-SI for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:03:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrwRJ-0004Su-FU for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:03:28 -0500 Original-Received: from smtprelay-h31.telenor.se ([213.150.131.4]:40161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrwRJ-0004Sd-8U for bug-gnu-emacs@gnu.org; Sun, 06 Jan 2013 15:03:25 -0500 Original-Received: from ipb5.telenor.se (ipb5.telenor.se [195.54.127.168]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id AAD14E9390 for ; Sun, 6 Jan 2013 21:03:22 +0100 (CET) X-SMTPAUTH-B2: [mategn] X-SENDER-IP: [85.229.47.157] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmTYAF7Y6VBV5S+dPGdsb2JhbABFgkFGQIcsqwGHYRYDAQEBATg0gl0CgWOISJgWnVeMdXeCSGEDqUk X-IronPort-AV: E=Sophos;i="4.84,420,1355094000"; d="scan'208";a="256820059" Original-Received: from c-9d2fe555.032-29-73746f10.cust.bredbandsbolaget.se ([85.229.47.157]) by ipb5.telenor.se with ESMTP; 06 Jan 2013 21:03:07 +0100 X-Mailer: Apple Mail (2.936) 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.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:69442 Archived-At: Parsing compilation messages in compilation-mode can be very slow for large buffers (thousands of error lines); it can take many seconds. Experiments show that it is the presence of omake in compilation-error-regexp-alist that causes most of the trouble; removing it mostly cures the problem. The omake regexp does not look too troublesome, but there are some omake-specific hacks in compile.el that are more worrying. In particular, this code (in compilation-parse-errors) looks suspicious: (cond ((not (memq 'omake compilation-error-regexp-alist)) nil) ((string-match "\\`\\([^^]\\|^\\( \\*\\|\\[\\)\\)" pat) nil) ;; Not anchored or anchored but already allows empty spaces. (t (setq pat (concat "^ *" (substring pat 1))))) The slightly alarming concept of regexp-matching a regexp aside, this one doesn't make sense - shouldn't the ^ (following the \|) be escaped? Apparently the code was at some time changed from (when (and (= ?^ (aref pat 0)) ; anchored: starts with "^" ;; but does not allow an arbitrary number of leading spaces (not (and (= ? (aref pat 1)) (= ?* (aref pat 2))))) which looks more correct, and conveys the intent somewhat better (and may be more efficient than the regexp for all I know). It's not clear to me how the present code could ever have worked. At the very least the regexp in compilation-parse-errors should be fixed. In GNU Emacs 24.1.1 (powerpc-apple-darwin, NS apple-appkit-1038.36) of 2012-06-10 on bob.porkrind.org Windowing system distributor `Apple', version 10.3.949