Subject: bug#3441: 23.0.94; *compilation* long lines painfully slow

From: Chong Yidong <[email-masked]>
Date: Wed, 17 Jun 2009 12:36:36 -0400

> Create a Makefile with the contents:
>
> all:
> 	@echo [insert 5000 chars]
>
> Run emacs -Q and do Tools > Compile... RET and I see Emacs create the
> *compilation* window and insert chunks of the echo output.  23.0.94
> takes 20+ seconds to complete it and is pretty much unusable during that
> time.  22.3 takes 1 second.  Looking back at earlier pretests, this also
> applies to 23.0.91.

This is due to the following in compilation-error-regexp-alist-alist:

  (maven
   ;; Maven is a popular build tool for Java.  Maven is Free Software.
   "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)

which was added here:

2007-07-25  Joakim Verona  <[email-masked]>  (tiny change)

	* progmodes/compile.el (compilation-error-regexp-alist-alist):
	Add support for the Maden build tool.

This regexp is pathologically slow on long lines.  Since the performance
impact is quite serious, and this bug has affected more than one user, I
went ahead and commented out this line in compile.el.

Joakim, could try to come up with a faster regexp?