From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Any idea about what makes Emacs slow reading on pipes? Date: Sat, 17 May 2003 19:07:02 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305172307.h4HN728c007013@rum.cs.yale.edu> References: <5x1xyye3y4.fsf@kfs2.cua.dk> <5xznllw0wp.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053212863 25726 80.91.224.249 (17 May 2003 23:07:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 17 May 2003 23:07:43 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 18 01:07:41 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19HAmD-0006gm-00 for ; Sun, 18 May 2003 01:07:41 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19HAvG-0006uc-00 for ; Sun, 18 May 2003 01:17:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HAmk-0008EM-02 for emacs-devel@quimby.gnus.org; Sat, 17 May 2003 19:08:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19HAlt-000878-00 for emacs-devel@gnu.org; Sat, 17 May 2003 19:07:21 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19HAlp-00084G-00 for emacs-devel@gnu.org; Sat, 17 May 2003 19:07:18 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HAld-0007w5-00; Sat, 17 May 2003 19:07:05 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h4HN73x6007015; Sat, 17 May 2003 19:07:03 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h4HN728c007013; Sat, 17 May 2003 19:07:03 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: storm@cua.dk (Kim F. Storm) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13958 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13958 > > No, that isn't it. I can pipe the stuff into |cat >/dev/null instead > > of Emacs, and it will be finished in a whiffy. Emacs must be using > > some sort of system call that _stops_ dd most of the time from being > > able to so another write to the pipe until the Linux scheduler has run > > again (which it does at the rate of about 100 per second, almost > > exactly the rate at which characters arrive). > That is because emacs is using a pty by default for process i/o (I But David pointed out several times that asking Emacs to use a pipe didn't make any difference. BTW, on my machine (266Mhz PII) the result of his test is basically always 1024. If I put the process' output in a hidden buffer, I then get mostly 1024 but a few smaller entries, the smaller being 382 on the test run I did. Looks like my Emacs is just not fast enough. > Come on yourself... This illustrates that if you use > "tex ... | dd bs=1k" > instead of just > "tex ..." > in acutex, you'll probably end up with much faster performance > since you will get buffered output from tex. But there's still something very fishy: he gets poor performance while at the same time Emacs only reads one char at a time. In your interpretation, the reason why only 1 char is read each time is because Emacs is so fast that it keeps up with the input data, but then why would the whole thing be so slow (considering that `dd' is pretty fast when writing somewhere else, even with 1-byte-at-a-time buffering). So is it that Emacs ends up somehow slowing down `dd' to a crawl ? How ? > M-: (setq process-connection-type nil) > before you run your acutex process, and see if that makes a difference. I think it's pretty clear that his test case is showing anomalous behavior, based on his description. And his test case doesn't use AUCTeX. I can't reproduce it, tho. Stefan