From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#5599: 23.1; compilation error regexp "watcom" slow on long lines Date: Fri, 19 Feb 2010 08:30:58 +1100 Message-ID: <87pr42qlil.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1266529986 11592 80.91.229.12 (18 Feb 2010 21:53:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Feb 2010 21:53:06 +0000 (UTC) To: 5599@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 18 22:53:00 2010 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.69) (envelope-from ) id 1NiEIt-0002Yf-HP for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2010 22:52:59 +0100 Original-Received: from localhost ([127.0.0.1]:44848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiEIt-0001hA-0y for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2010 16:52:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiEIo-0001fL-IJ for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:52:54 -0500 Original-Received: from [140.186.70.92] (port=44437 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiEIn-0001cs-JH for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:52:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiEIm-0007q9-H2 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:52:53 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44305) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiEIm-0007q2-Bb for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:52:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NiDyd-0007gJ-2E; Thu, 18 Feb 2010 16:32:03 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Feb 2010 21:32:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5599 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.126652870129509 (code B ref -1); Thu, 18 Feb 2010 21:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2010 21:31: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 1NiDyH-0007fu-03 for submit@debbugs.gnu.org; Thu, 18 Feb 2010 16:31:41 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiDy0-0007fd-T3 for submit@debbugs.gnu.org; Thu, 18 Feb 2010 16:31:39 -0500 Original-Received: from mail.gnu.org ([199.232.76.166]:60337 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiDxw-0003kn-Rs for submit@debbugs.gnu.org; Thu, 18 Feb 2010 16:31:20 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NiDxu-0005Yh-SF for submit@debbugs.gnu.org; Thu, 18 Feb 2010 16:31:20 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:52711) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NiDxu-0005Yd-M9 for submit@debbugs.gnu.org; Thu, 18 Feb 2010 16:31:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiDxu-0002QR-AC for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:31:18 -0500 Original-Received: from [140.186.70.92] (port=46037 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiDxp-0002Pg-OB for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:31:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiDxo-0005sw-26 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:31:13 -0500 Original-Received: from mailout1-14.pacific.net.au ([125.255.80.133]:37784 helo=mailout1.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiDxn-0005sf-G6 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 16:31:12 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 977C152C77C for ; Fri, 19 Feb 2010 08:31:06 +1100 (EST) Original-Received: from blah.blah (ppp2CF2.dyn.pacific.net.au [61.8.44.242]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 9B9DE2740F for ; Fri, 19 Feb 2010 08:31:05 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NiDxb-0002gY-N2 for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 08:30:59 +1100 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 18 Feb 2010 16:32:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:35180 Archived-At: --=-=-= If a compilation-mode buffer has a very long line, the `watcom' error regexp pattern is very slow at not matching. For example the foo.el below takes my old pc about 20 seconds to match nothing. The line in foo.el is 10,000 chars long, which might seem improbable, but in fact arises very easily from a "make" echoing a list of filenames from a distribution, eg. 200 filenames averaging 50 chars each including paths. (I've got one dist where the make spits 12,000 char lines, and another repeated 1500 char lines ...). I suppose the optional drive letter part of the pattern makes it backtrack to every character. I wonder if it could anchor to the start of the line to restrict that. (The alternative could be to loosen what's considered a filename there.) 2010-02-18 Kevin Ryde * progmodes/compile.el (compilation-error-regexp-alist-alist): In `watcom' add "^" for filename only at start of line. Avoids slowness backtracking to every char of a long line, O(N^2) in the length, eg. 20 seconds to fail to match a 10,000 char line. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=compile.el.watcom.diff --- compile.el.~1.504.~ 2009-11-26 10:28:08.000000000 +1100 +++ compile.el 2010-02-18 19:39:05.000000000 +1100 @@ -350,7 +350,7 @@ "^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3) (watcom - "\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)): ?\ + "^\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)): ?\ \\(?:\\(Error! E[0-9]+\\)\\|\\(Warning! W[0-9]+\\)\\):" 1 2 nil (4)) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=foo.el Content-Transfer-Encoding: quoted-printable (progn (switch-to-buffer "x") (erase-buffer) (dotimes (i 1000) (insert "xfoo barxx")) (insert "\n") =20=20 (require 'compile) (setq compilation-error-regexp-alist '(watcom)) (let ((beg (float-time))) (compilation-mode) (message "took %.2f" (- (float-time) beg)))) --=-=-= In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t --=-=-=--