GNU bug report logs - #895
slow processing of process output

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>; dated Fri, 5 Sep 2008 15:50:04 UTC; Maintainer for emacs is bug-gnu-emacs <at> gnu.org.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 19:17:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 15:17:42 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeXbS-00038z-Df
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 15:17:42 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier <at> iro.umontreal.ca>) id 1QeXbQ-00038g-2h
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 15:17:40 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAJKzFE5FxIV4/2dsb2JhbABTqAd4iHrDT4Y3BJ5rhC8
X-IronPort-AV: E=Sophos;i="4.65,488,1304308800"; d="scan'208";a="120708537"
Received: from 69-196-133-120.dsl.teksavvy.com (HELO ceviche.home)
	([69.196.133.120])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	06 Jul 2011 15:17:34 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 39F8B660D9; Wed,  6 Jul 2011 15:17:34 -0400 (EDT)
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dan Nicolaescu <dann <at> gnu.org>
Subject: Re: bug#895: slow processing of process output
Message-ID: <jwv1uy3qkxx.fsf-monnier+emacs <at> gnu.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
	<yxqaacrmnkm.fsf <at> fencepost.gnu.org>
Date: Wed, 06 Jul 2011 15:17:34 -0400
In-Reply-To: <yxqaacrmnkm.fsf <at> fencepost.gnu.org> (Dan Nicolaescu's message of
	"Wed, 06 Jul 2011 11:32:57 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 895
Cc: larsi <at> gnus.org, 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> For example compare the time to run make bootstrap when using M-x
> compile vs doing it in an xterm.

Agreed.  I encourage people to try and look into this problem.
First thing is to profile to figure out where the time is spent.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 19:16:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 15:16:07 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeXZu-00035w-Qc
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 15:16:07 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier <at> iro.umontreal.ca>) id 1QeXZs-00035K-0m
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 15:16:05 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAJKzFE5FxIV4/2dsb2JhbABTqAd4iHrDT4Y3BJ5rhC8
X-IronPort-AV: E=Sophos;i="4.65,488,1304308800"; d="scan'208";a="120708357"
Received: from 69-196-133-120.dsl.teksavvy.com (HELO ceviche.home)
	([69.196.133.120])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	06 Jul 2011 15:15:58 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id CD158660D9; Wed,  6 Jul 2011 15:15:42 -0400 (EDT)
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#895: slow processing of process output
Message-ID: <jwv7h7vql4q.fsf-monnier+emacs <at> gnu.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
	<jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
	<m3liwb766o.fsf <at> quimbies.gnus.org>
Date: Wed, 06 Jul 2011 15:15:42 -0400
In-Reply-To: <m3liwb766o.fsf <at> quimbies.gnus.org> (Lars Magne Ingebrigtsen's
	message of "Wed, 06 Jul 2011 17:57:35 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 895
Cc: 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> I wonder whether (in the long term) it would make more sense to have the
> `M-x grep' command be less...  shell-script-ey.

There are other commands that do that that (e.g. rgrep).
I like grep specifically because the Emacs wrapper is shallow which lets
me do anything I fancy so long as the output has the expected format.

> That is, if we instead prompted for the regexp we wanted to match
> explicitly, then we could highlight it ourselves instead of relying on
> grep to do it.

Actually doing this reliably can be tricky because of slight divergence
in the syntax and features of regular expressions accepted by Emacs and
by the various greps out there.

> Ok, here's one other possibility off the top of my head: What about if
> Emacs parsed the command line?  :-)

You go boy!


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 18:50:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 14:50:27 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeXB5-0002P4-1B
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 14:50:27 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi <at> gnus.org>) id 1QeXB2-0002Or-Js
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 14:50:25 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi <at> gnus.org>)
	id 1QeXAo-0000SM-1f; Wed, 06 Jul 2011 20:50:10 +0200
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Subject: Re: bug#895: slow processing of process output
In-Reply-To: <6D56BDCE22F94C77B10AB679E92860C6 <at> us.oracle.com> (Drew Adams's
	message of "Wed, 6 Jul 2011 10:58:35 -0700")
Date: Wed, 06 Jul 2011 20:50:00 +0200
Message-ID: <m3liwbw8fb.fsf <at> quimbies.gnus.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
	<jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
	<m3liwb766o.fsf <at> quimbies.gnus.org>
	<6D56BDCE22F94C77B10AB679E92860C6 <at> us.oracle.com>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
X-Now-Playing: Demdike Stare's _Tryptych (2): Liberation Through Hearing_:
	"Matilda's Dream"
X-Hashcash: 1:23:110706:drew.adams <at> oracle.com::Bk3elmnRM7ozp3tS:00000000000000000000000000000000000000008/YC
X-Hashcash: 1:23:110706:895 <at> debbugs.gnu.org::0nPrlRFanogbVn1r:000000000000000000000000000000000000000000jXFv
X-Hashcash: 1:23:110706:monnier <at> iro.umontreal.ca::8dnDg7sl/Ucw1177:00000000000000000000000000000000000019y8j
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1QeXAo-0000SM-1f
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi <at> gnus.org
MailScanner-NULL-Check: 1310583010.57599 <at> wkeZ+fuZLJ36arVmLEwKjA
X-Spam-Status: No
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 895
Cc: 'Stefan Monnier' <monnier <at> iro.umontreal.ca>, 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.8 (--)

"Drew Adams" <drew.adams <at> oracle.com> writes:

> Absolutely.  But there is no reason to conflate "[having] the `M-x
> grep' command be less...shell-script-ey" with doing the highlighting
> in Lisp.  Why do you want less shell-script-ey?

For the very simple use cases, having "grep -nH -e " seems like a
distraction.  But I usually want it more shell-script-ey than less --
that `M-x grep' adds "/dev/null" at the end has often annoyed me
greatly, because you can't then say "grep foo *.el | grep -v bar".

> That is what I did, IIUYC.  The relevant bit of the compile+20.el code:
>
> ;; Remember `grep-pattern' for highlighting, if highlighting is possible.
> (cond (;; Quoted pattern (either "..." or '...')

Yeah, That's what I was thinking of.  :-)

> FWIW, I think the Emacs Dev approach of using external `grep'
> highlighting is generally not bad (but there have been a few bugs that
> needed to be fixed along the way).

Yes, it's a good idea, but there are these corner cases where it doesn't
work quite well.  Like when you have some (implicit) commands in the
pipeline that reacts badly to being run in a terminal, like the guy who
did a "git log" (or something?), and git then started "less", because it
thought it was in a terminal.

So to me it looks like the best long-term general solution is to bind
`process-connection-type' to nil in compile.el, and fix the highlighting
in Emacs Lisp, like your code does.

Perhaps.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 17:58:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 13:58:55 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeWND-0007jo-Dz
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 13:58:55 -0400
Received: from acsinet15.oracle.com ([141.146.126.227])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams <at> oracle.com>) id 1QeWNB-0007jW-8n
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 13:58:54 -0400
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id
	p66Hwj2J026791
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 6 Jul 2011 17:58:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	p66HwhD5013963
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 6 Jul 2011 17:58:44 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p66HwbGg032697; Wed, 6 Jul 2011 12:58:38 -0500
Received: from dradamslap1 (/10.159.55.239)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 06 Jul 2011 10:58:37 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Lars Magne Ingebrigtsen'" <larsi <at> gnus.org>,
	"'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
References: <m11vthqpn9.fsf <at> gmx.at>
	<m3liwk86q9.fsf <at> quimbies.gnus.org><jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
	<m3liwb766o.fsf <at> quimbies.gnus.org>
Subject: RE: bug#895: slow processing of process output
Date: Wed, 6 Jul 2011 10:58:35 -0700
Message-ID: <6D56BDCE22F94C77B10AB679E92860C6 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <m3liwb766o.fsf <at> quimbies.gnus.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
Thread-Index: Acw7+Dck5Q7YfjFtQh2hedHjZSK3NQAAsV8A
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A020208.4E14A257.00DD:SCFMA922111,ss=1,re=-4.000,fgs=0
X-Spam-Score: -4.4 (----)
X-Debbugs-Envelope-To: 895
Cc: 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.4 (----)

> That is, if we instead prompted for the regexp we wanted to match
> explicitly, then we could highlight it ourselves instead of relying on
> grep to do it.

I did that (without prompting), for Emacs 20 & 21.  See:
http://www.emacswiki.org/emacs/download/compile%2b20.el

It was I who proposed that vanilla Emacs itself highlight the matches.  That
idea was adopted, but Emacs Dev decided to do the highlighting using escape
chars provided by (some) external `grep' commands.

(So I adjusted my code too to use that approach:
http://www.emacswiki.org/emacs/download/grep%2b.el)

> However, `M-x grep' as it is is pretty neat, because you can 
> fiddle with all the options and do
> grep ... | grep -v | etc

Absolutely.  But there is no reason to conflate "[having] the `M-x grep' command
be less...shell-script-ey" with doing the highlighting in Lisp.  Why do you want
less shell-script-ey?

My code did the highlighting in Lisp, but it should not in any way interfere
with piping etc.  (However, for unrelated reasons piping with Emacs `grep' is
not available until Emacs 22, and it was Emacs 22 that introduced
external-`grep' highlighting.)

> So providing something that is as flexible as `M-x grep' is today, but
> allow Emacs greater control of the output sounds difficult.

Not at all (IIUYC).

> Ok, here's one other possibility off the top of my head: What about if
> Emacs parsed the command line?  :-) That is, if you're typing
> grep -nH -e foo.*bar *.el
> then the grep syntax isn't that impossible to parse.  I mean, finding
> the regexp, and highlighting the matching bits.

That is what I did, IIUYC.  The relevant bit of the compile+20.el code:

;; Remember `grep-pattern' for highlighting, if highlighting is possible.
(cond (;; Quoted pattern (either "..." or '...')
       (string-match
        (concat
         grep-program
         "[ \t]*\\(-[a-zA-Z]+\\s-+\\)*[ \t]*\\('[^']+'\\|\"[^\"]+\"\\)") ;"
        command-args)
       (setq grep-pattern
             (substring command-args
                        (1+ (match-beginning 2)) (1- (match-end 2)))))
      (;; Unquoted pattern.
       (string-match
        (concat grep-program
                "[ \t]*\\(-[a-zA-Z]+\\s-+\\)*[ \t]*\\([^ \n\t'\"]+\\)") ; "
        command-args)
       (setq grep-pattern
             (substring command-args (match-beginning 2) (match-end 2))))
      (t;; Bad pattern.
       (setq grep-pattern nil)))

;; Account for a case-insensitivity option.
(when (and (not (string= "" grep-case-insensitive-option))
           (string-match grep-case-insensitive-option command-args))
  (setq grep-pattern (mapconcat
                      (lambda (char)
                        (if (or (and (>= char ?a) (<= char ?z))
                                (and (>= char ?A) (<= char ?Z)))
                            (concat "["  (char-to-string (downcase char))
                                    (char-to-string (upcase char)) "]")
                          (char-to-string char)))
                      grep-pattern "")))

This is a quick hack that works well in general (for Emacs 20/21).  But note
that the `grep-pattern' highlighting is not anchored after the file name and
line number, so if the file name itself matches the `grep-pattern' then it
doesn't highlight the latter.

Someone could work out the code to anchor the pattern match properly.  I didn't
bother to try, since it is good enough as is, for my use.

> It isn't difficult to imagine more complex command lines that Emacs
> wouldn't be able to parse, though.  And you'd lose highlighting of the
> matches there...

Yes.

FWIW, I think the Emacs Dev approach of using external `grep' highlighting is
generally not bad (but there have been a few bugs that needed to be fixed along
the way).





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 15:57:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 11:57:56 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeUU7-0002K6-Sm
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:57:56 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi <at> gnus.org>) id 1QeUU4-0002Ji-E5
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:57:54 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi <at> gnus.org>)
	id 1QeUTt-00067I-Aj; Wed, 06 Jul 2011 17:57:41 +0200
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#895: slow processing of process output
In-Reply-To: <jwvbox7tpng.fsf-monnier+emacs <at> gnu.org> (Stefan Monnier's message
	of "Wed, 06 Jul 2011 11:07:13 -0400")
Date: Wed, 06 Jul 2011 17:57:35 +0200
Message-ID: <m3liwb766o.fsf <at> quimbies.gnus.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
	<jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
X-Now-Playing: Various's _Delta Swamp Rock (2)_: "Dan Penn - If Love Was Money"
X-Hashcash: 1:23:110706:895 <at> debbugs.gnu.org::StG46zftbYi8qiXX:0000000000000000000000000000000000000000000FHr
X-Hashcash: 1:23:110706:monnier <at> iro.umontreal.ca::n9cF/ZAmnjNeAfRC:0000000000000000000000000000000000000FYDM
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1QeUTt-00067I-Aj
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi <at> gnus.org
MailScanner-NULL-Check: 1310572661.43299 <at> Bp/mkq7HdeQdCVNmXKDFxA
X-Spam-Status: No
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 895
Cc: 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.8 (--)

I wonder whether (in the long term) it would make more sense to have the
`M-x grep' command be less...  shell-script-ey.

That is, if we instead prompted for the regexp we wanted to match
explicitly, then we could highlight it ourselves instead of relying on
grep to do it.

However, `M-x grep' as it is is pretty neat, because you can fiddle with
all the options and do

grep ... | grep -v | etc

So providing something that is as flexible as `M-x grep' is today, but
allow Emacs greater control of the output sounds difficult.

Ok, here's one other possibility off the top of my head: What about if
Emacs parsed the command line?  :-)

That is, if you're typing

grep -nH -e foo.*bar *.el

then the grep syntax isn't that impossible to parse.  I mean, finding
the regexp, and highlighting the matching bits.

It isn't difficult to imagine more complex command lines that Emacs
wouldn't be able to parse, though.  And you'd lose highlighting of the
matches there...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 15:57:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 11:57:54 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeUU5-0002Jt-Rf
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:57:54 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi <at> gnus.org>) id 1QeUU3-0002Jg-TB
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:57:52 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi <at> gnus.org>)
	id 1QeUTs-00067B-CB; Wed, 06 Jul 2011 17:57:40 +0200
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#895: slow processing of process output
In-Reply-To: <jwvbox7tpng.fsf-monnier+emacs <at> gnu.org> (Stefan Monnier's message
	of "Wed, 06 Jul 2011 11:07:13 -0400")
Date: Wed, 06 Jul 2011 17:51:07 +0200
Message-ID: <m3pqln76hg.fsf <at> quimbies.gnus.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
	<jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
X-Now-Playing: Various's _Delta Swamp Rock (2)_: "Dan Penn - If Love Was Money"
X-Hashcash: 1:23:110706:895 <at> debbugs.gnu.org::pibxMAGxl2BBw0gs:0000000000000000000000000000000000000000004DKy
X-Hashcash: 1:23:110706:monnier <at> iro.umontreal.ca::LQSGtZ+DbdD4tWGM:0000000000000000000000000000000000000nx5c
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1QeUTs-00067B-CB
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi <at> gnus.org
MailScanner-NULL-Check: 1310572660.45649 <at> wI+7ZjIT3clFIz2BuHE1EA
X-Spam-Status: No
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 895
Cc: 895 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.8 (--)

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> I've now bound `process-connection-type' to nil in `rgrep' for Emacs 24.
>
> What makes it faster?
> Could it be that with process-connection-type set to nil grep doesn't emit
> the color escape sequences?

Yes.

I've now reverted the change and reopened this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 15:33:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 11:33:07 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeU66-0001nJ-Rn
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:33:07 -0400
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dann <at> gnu.org>) id 1QeU64-0001mn-OI
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:33:05 -0400
Received: from dann by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <dann <at> gnu.org>)
	id 1QeU5x-0003tk-F7; Wed, 06 Jul 2011 11:32:57 -0400
From: Dan Nicolaescu <dann <at> gnu.org>
To: 895 <at> debbugs.gnu.org
Subject: Re: bug#895: slow processing of process output
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
X-Debbugs-No-Ack: yes
Date: Wed, 06 Jul 2011 11:32:57 -0400
In-Reply-To: <m3liwk86q9.fsf <at> quimbies.gnus.org> (Lars Magne Ingebrigtsen's
	message of "Thu, 30 Jun 2011 03:10:06 +0200")
Message-ID: <yxqaacrmnkm.fsf <at> fencepost.gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -6.5 (------)
X-Debbugs-Envelope-To: 895
Cc: larsi <at> gnus.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.5 (------)

Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> Markus Triska <markus.triska <at> gmx.at> writes:
>
>> I can reproduce the problem on OSX, and could significantly improve the
>> running time by setting process-connection-type to nil before doing the
>> rgrep. Let rgrep.el consist of:
>>
>>    (grep-compute-defaults)
>>    (setq process-connection-type nil)
>>    (rgrep "emacs" "*.el" "~/emacs/lisp/")
>>
>>    (while (process-status "grep")
>>      (sit-for 0.1))
>
> I've now bound `process-connection-type' to nil in `rgrep' for Emacs 24.

This might solve the specific `rgrep' case, but that was only a specific
easy to reproduce example.
Processing process output is slow for other things too.
For example compare the time to run
make bootstrap
when using M-x compile

vs doing it in an xterm.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895 <at> debbugs.gnu.org:


Received: (at 895) by debbugs.gnu.org; 6 Jul 2011 15:07:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 11:07:37 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QeThQ-0001Bc-RJ
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:07:37 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier <at> iro.umontreal.ca>) id 1QeThO-0001BL-W9
	for 895 <at> debbugs.gnu.org; Wed, 06 Jul 2011 11:07:35 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhAIAAF5FE5FxIV4/2dsb2JhbABTmRmOa3iIesMqhjcEnmuELw
X-IronPort-AV: E=Sophos;i="4.65,487,1304308800"; d="scan'208";a="120677377"
Received: from 69-196-133-120.dsl.teksavvy.com (HELO ceviche.home)
	([69.196.133.120])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	06 Jul 2011 11:07:28 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 7B64C660D9; Wed,  6 Jul 2011 11:07:13 -0400 (EDT)
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 895 <at> debbugs.gnu.org
Subject: Re: bug#895: slow processing of process output
Message-ID: <jwvbox7tpng.fsf-monnier+emacs <at> gnu.org>
References: <m11vthqpn9.fsf <at> gmx.at> <m3liwk86q9.fsf <at> quimbies.gnus.org>
Date: Wed, 06 Jul 2011 11:07:13 -0400
In-Reply-To: <m3liwk86q9.fsf <at> quimbies.gnus.org> (Lars Magne Ingebrigtsen's
	message of "Thu, 30 Jun 2011 03:10:06 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 895
Cc: larsi <at> gnus.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

>> I can reproduce the problem on OSX, and could significantly improve the
>> running time by setting process-connection-type to nil before doing the
>> rgrep. Let rgrep.el consist of:
>> 
>> (grep-compute-defaults)
>> (setq process-connection-type nil)
>> (rgrep "emacs" "*.el" "~/emacs/lisp/")
>> 
>> (while (process-status "grep")
>> (sit-for 0.1))

> I've now bound `process-connection-type' to nil in `rgrep' for Emacs 24.

What makes it faster?
Could it be that with process-connection-type set to nil grep doesn't emit
the color escape sequences?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#895; Package emacs. Full text available.

Message received at 895-close <at> debbugs.gnu.org:


Received: (at 895-close) by debbugs.gnu.org; 30 Jun 2011 01:10:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 29 21:10:26 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Qc5ly-0000x6-En
	for submit <at> debbugs.gnu.org; Wed, 29 Jun 2011 21:10:26 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi <at> gnus.org>) id 1Qc5lv-0000ws-Ns
	for 895-close <at> debbugs.gnu.org; Wed, 29 Jun 2011 21:10:24 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi <at> gnus.org>)
	id 1Qc5li-0007fT-SC; Thu, 30 Jun 2011 03:10:10 +0200
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Markus Triska <markus.triska <at> gmx.at>
Subject: Re: bug#895: slow processing of process output
In-Reply-To: <m11vthqpn9.fsf <at> gmx.at> (Markus Triska's message of "Sun, 01 Mar
	2009 15:33:14 +0100")
Date: Thu, 30 Jun 2011 03:10:06 +0200
Message-ID: <m3liwk86q9.fsf <at> quimbies.gnus.org>
References: <m11vthqpn9.fsf <at> gmx.at>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEWm6vtBXblmkfDA/v8H
	BAtUe+EKBxMPDiMMCRYfJ1pH944OAAACZElEQVQ4jXWSwWrjMBCGZ5sXWC2Y4lvxkkNvhT7BgrB9
	XBl86N0oyrEQOvK9SOqtLl2UedudkZM0h90JsTX/p/k1sgSweTzFZVACAP4HLjl8P48eHmFzBb69
	XwD7wMMF3H9c+W+uAZ2H4vIPADfNHT/vf16DB2i24zj+3jzC7fsXGESUGHgNnDelj2ZLS3XSx4aX
	R2SvG8ku8jhUBWxW/RJbM4wruNaNqol+rKA5i6IRKVWNwx2DefUWcVGndQSUVriIFOdNCdkIQHXy
	WFjZ8nsFA0DxXZQScJ8FyC63bFXn+U/TmC8gvZkRhifED86qLQPKJHplqhGaMxi/wCiAFOUVjM0T
	SW8CaoK2RaoYiDKsLbGVIrBa6zSrqi4bkY4U/wwDryetHVLGef3uxqjKZLDBupSssw59Qikzo6qe
	EFic2hSSDykl9HFe2IrIQwoupD70Kb3YlCLyn1T2CYK1Nk52si449vTBttYiIhTvJICtXCi6cwyc
	7XKmOacQkpRIJ9YmhF3Qtg08LfrkbKkTECF5JwMJu9YIcJEXD3ZKxYKXTmuIFU/iCSEwkJ1EUZN0
	xVNFYHPOZjrFomDGEiWt+Yg5RpOXGjjPkp/vm0Q97TPweykp3zSpqGtFoQ0IPLWjxTwTkrmtlFHL
	wWPkxblc61+1DvqtPj7X5PeH+Bl3M1TmqPWe+Bzb+dDRi37LUZoBdcsaIetI2GWtO+wi0Qw1HnWX
	D3LyLc6e3zvs/WsLVH/qNdqDPr7yBYjJ9cEC63wZNBbARkHrfkptC9n3Mx0LEN27oLtJ9xZ2HjGc
	argx+XDxVffxLxcXekNt/DaTAAAAAElFTkSuQmCC
X-Now-Playing: Epic 45's _In All The Empty Houses_: "Ghosts on Tape"
X-Hashcash: 1:23:110630:dann <at> ics.uci.edu::0qNOi9Mtu9eG16VD:00j9D
X-Hashcash: 1:23:110630:markus.triska <at> gmx.at::VMD1H/77MgQ/L78N:00000000000000000000000000000000000000000K1Gi
X-Hashcash: 1:23:110630:895 <at> debbugs.gnu.org::Z4xCKGmPL+rAVSZO:000000000000000000000000000000000000000000dyqW
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1Qc5li-0007fT-SC
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi <at> gnus.org
MailScanner-NULL-Check: 1310001011.05366 <at> t0hkuzpgKubgisFd0QqAtg
X-Spam-Status: No
X-Spam-Score: -3.1 (---)
X-Debbugs-Envelope-To: 895-close
Cc: 895-close <at> debbugs.gnu.org, Dan Nicolaescu <dann <at> ics.uci.edu>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.1 (---)

Markus Triska <markus.triska <at> gmx.at> writes:

> I can reproduce the problem on OSX, and could significantly improve the
> running time by setting process-connection-type to nil before doing the
> rgrep. Let rgrep.el consist of:
>
>    (grep-compute-defaults)
>    (setq process-connection-type nil)
>    (rgrep "emacs" "*.el" "~/emacs/lisp/")
>
>    (while (process-status "grep")
>      (sit-for 0.1))

I've now bound `process-connection-type' to nil in `rgrep' for Emacs 24.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Notification sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
bug acknowledged by developer. Full text available.
Reply sent to Lars Magne Ingebrigtsen <larsi <at> gnus.org>:
You have taken responsibility. Full text available.

Message received at 895 <at> emacsbugs.donarmstrong.com:


Received: (at 895) by emacsbugs.donarmstrong.com; 1 Mar 2009 14:33:31 +0000
From markus.triska <at> gmx.at Sun Mar  1 06:33:31 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.0 required=4.0 tests=FVGT_m_MULTI_ODD autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n21EXQLA004532
	for <895 <at> emacsbugs.donarmstrong.com>; Sun, 1 Mar 2009 06:33:28 -0800
Received: (qmail invoked by alias); 01 Mar 2009 14:33:20 -0000
Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212]
  by mail.gmx.net (mp069) with SMTP; 01 Mar 2009 15:33:20 +0100
X-Authenticated: #4064391
X-Provags-ID: V01U2FsdGVkX1+m4SEYTzCmidDawEt7CR4g81B0TPSYSGcLlI8908
	k4VUNHG03I/AYV
Received: by mt-computer.local (Postfix, from userid 502)
	id 92400C63B3C; Sun,  1 Mar 2009 15:33:14 +0100 (CET)
From: Markus Triska <markus.triska <at> gmx.at>
To: 895 <at> debbugs.gnu.org
Cc: Dan Nicolaescu <dann <at> ics.uci.edu>
Subject: Re: slow processing of process output
Date: Sun, 01 Mar 2009 15:33:14 +0100
Message-ID: <m11vthqpn9.fsf <at> gmx.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.72


I can reproduce the problem on OSX, and could significantly improve the
running time by setting process-connection-type to nil before doing the
rgrep. Let rgrep.el consist of:

   (grep-compute-defaults)
   (setq process-connection-type nil)
   (rgrep "emacs" "*.el" "~/emacs/lisp/")

   (while (process-status "grep")
     (sit-for 0.1))

and do:

   $ time emacs -Q --script rgrep.el

Then contrast this with retaining t for process-connection-type.

I have seen that using a pty can be a major performance problem also
when communicating with other external programs, and I recommend to
let-bind it to nil before starting the process when a pipe suffices.




Acknowledgement sent to Markus Triska <markus.triska <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text available.
Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#895; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 895) by emacsbugs.donarmstrong.com; 2 Oct 2008 09:29:35 +0000
Received: from sallyv2.ics.uci.edu (sallyv2.ics.uci.edu [128.195.1.120])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m929TW3o024226
	for <895 <at> emacsbugs.donarmstrong.com>; Thu, 2 Oct 2008 02:29:33 -0700
Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93])
	by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m929TDmJ029441
	for <895 <at> emacsbugs.donarmstrong.com>; Thu, 2 Oct 2008 02:29:13 -0700 (PDT)
Received: (from dann <at> localhost)
	by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id m929TCiH016508;
	Thu, 2 Oct 2008 02:29:12 -0700 (PDT)
Date: Thu, 2 Oct 2008 02:29:12 -0700 (PDT)
Message-Id: <200810020929.m929TCiH016508 <at> mothra.ics.uci.edu>
From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: 895 <at> debbugs.gnu.org
Subject: Re: bug#895: slow processing of process output
References: <200809051543.m85FhWHV008307 <at> sallyv1.ics.uci.edu>
In-Reply-To: <200809051543.m85FhWHV008307 <at> sallyv1.ics.uci.edu> (Dan
	Nicolaescu's message of "Fri, 05 Sep 2008 08:43:32 -0700")
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-ICS-MailScanner-Information: Please contact the ISP for more information
X-ICS-MailScanner-ID: m929TDmJ029441
X-ICS-MailScanner: Found to be clean
X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5,
	autolearn=disabled, ALL_TRUSTED -1.44)
X-ICS-MailScanner-From: dann <at> mothra.ics.uci.edu

Dan Nicolaescu <dann <at> ics.uci.edu> writes:

  > emacs -Q -nw
  > M-x rgrep RET emacs RET *.el RET PATH_TO_EMACS_SOURCE_TREE/lisp RET
  > 
  > takes a few minutes.  The output is about 9000 lines.
  > 
  > Running the correspondind command:
  > 
  > find . \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o -type f \( -name *.el \) -print0 | xargs -0 -e grep -i -nH -e emacs
  > 
  > from a shell (and redirecting the output to a file) takes less than one second.

One more data point:

emacs -Q -nw

M-x lgrep RET emacs RET *.el RET PATH_TO_EMACS_SOURCE_TREE/lisp RET

takes 33 seconds.  It runs the command:  grep -i -nH -e emacs *.el

M-x shell RET time grep -i -nH -e emacs *.el
0.087u 0.020s 0:01.60 6.2%      0+0k 0+0io 0pf+0w
              ^^^^^^^
              A lot less than 33 seconds.




Acknowledgement sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text available.
Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#895; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,BAYES_00,FOURLA,
	RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 5 Sep 2008 15:44:26 +0000
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m85FiMUd023438
	for <submit <at> emacsbugs.donarmstrong.com>; Fri, 5 Sep 2008 08:44:23 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1KbdTy-0005yp-6x
	for bug-gnu-emacs <at> gnu.org; Fri, 05 Sep 2008 11:44:22 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1KbdTw-0005yP-F7
	for bug-gnu-emacs <at> gnu.org; Fri, 05 Sep 2008 11:44:21 -0400
Received: from [199.232.76.173] (port=35094 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1KbdTw-0005yM-Ap
	for bug-gnu-emacs <at> gnu.org; Fri, 05 Sep 2008 11:44:20 -0400
Received: from sallyv1.ics.uci.edu ([128.195.1.109]:33879)
	by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24)
	(Exim 4.60)
	(envelope-from <dann <at> ics.uci.edu>)
	id 1KbdTv-0001pk-8r
	for bug-gnu-emacs <at> gnu.org; Fri, 05 Sep 2008 11:44:19 -0400
X-ICS-MailScanner-Watermark: 1221234215.93362@/IJjnuIL3w8yKubib+KrGw
Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93])
	by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m85FhWHV008307
	for <bug-gnu-emacs <at> gnu.org>; Fri, 5 Sep 2008 08:43:33 -0700 (PDT)
Message-Id: <200809051543.m85FhWHV008307 <at> sallyv1.ics.uci.edu>
From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: slow processing of process output
Lines: 11
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 05 Sep 2008 08:43:32 -0700
Sender: dann <at> ics.uci.edu
X-ICS-MailScanner: Found to be clean
X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5,
	autolearn=disabled, ALL_TRUSTED -1.44)
X-ICS-MailScanner-From: dann <at> mothra.ics.uci.edu
X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta)


emacs -Q -nw
M-x rgrep RET emacs RET *.el RET PATH_TO_EMACS_SOURCE_TREE/lisp RET

takes a few minutes.  The output is about 9000 lines.

Running the correspondind command:

find . \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o -type f \( -name *.el \) -print0 | xargs -0 -e grep -i -nH -e emacs

from a shell (and redirecting the output to a file) takes less than one second.





Acknowledgement sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text available.
Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#895; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 20 Sep 2011 19:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.